DEV Community

Cover image for GitHub Project :Understanding git work flow
Frank Hahanyu
Frank Hahanyu

Posted on

GitHub Project :Understanding git work flow

INTRODUCTION

My first week at LuxDev Academy as a beginner in the tech field was awesome since all tutors gave us hands on tutoring , we covered installation of apps and understanding coding languages. For today I'll cover git workflow and all its components .

Version control can feel overwhelming when you first star writing code or managing data projects and for tools like git , they're designed to track changes in your projects over time using commands like git_add, git_commit, and git_push often feel like magic spells rather than logical steps.

To master or understand git you only need to understand the stages a file goes through during construction wich is :

1.The Working Directory

This is where you do the work and it consists of the actual files on your computer's files system inside your project folder. In her when you create a new file or modify an existing code those changes only exist on your working directory, meaning git only notices that changes have occurred but it doesn't track or save them automatically and for that to happen we use git status

2.The Staging Area

The staging area acts as the intermediate step between your actual workspace and your saved history.
Git selectively lets you choose which modified files belong together in the next check point . you stage a file changes from the working directory by inputting git add command , then you stage a specific file git add filename.py then stage all modified files at once git add

3.The Commit and Push

After the staging area we go ahead and commit to record those specific changes along with a clear descriptive message explaining what we updated( commit acts as a restore point).This is the commit prompt with a descriptive message i.e analysis data: git commit -m "add data analysis data"
In the push section , all your commits exist on your local computer but pushing takes all the commits and uploads them to a remote repository on GitHub and this is how you push it git push origin main

Conclusion

Git gives you full control over how your project's history is recorded, organized and shared. You need to be keen with how you key in your prompts cause once you miss a step a lot of errors pile up and with that, once you understand these four stages then you won't have a problem working with Git in your work developments.

Top comments (0)