DEV Community

Erick Mweri
Erick Mweri

Posted on

Understanding the Git Workflow: Working Directory, Staging, Commit and Push

Git is one of the tools used by most developers to manage and track changes in their project.
The Git workflow consists of several stages.

1. The working directory

The working directory was the folder on my computer where we created, Edited and deleted files and this happens when we use a directory called Git status

2. Staging

In the staging area is where we place the changes we want to commit.
Here we used term git add. which helped us to add a file.
After staging we back to check our status through Git status

3. commit

A commit saves the staged changes to my local Git repository.
We used the term:
git commit -m to update our homepage

4. push

A push sends your local commits to a remote Git-basics like one hosted on Git hub
Here we use git push
once the push is complete, your latest commits are available in remote repositories.

Here is a simple breakdown of the git workflow

Working Directory
|
| git add
v
Staging Area
|
| git commit
v
Local Repository
|
| git push
v
Remote Repository

Conclusion

Once you understand these four stages , you will have a strong foundation for using git in your everyday development work.

Top comments (0)