DEV Community

Cover image for Simple Git workflow for beginners
Maher Alkendi
Maher Alkendi

Posted on

Simple Git workflow for beginners

This post is to share the git workflow I use for my projects. I am mainly writing this post so I can use it as a cheat sheet from time to time. However, I think it will serve as a good reference for any developer that wants to go beyond the git add git commit git push workflow.

This posts assumes that you are familiar with the basics of git. If you are not then I recommend the video below, by Traversy Media for a quick overview:

Step 1: Create a branch for the feature you want to add and navigate to it

git checkout -b <branch-name>

Step 2: Make changes to your code

Use the following command to see changes:

git status

Step 3: Add changes to staging area

git add <files-changed>

Step 4: Commit changes and add a short description

git commit -m "<commit message>"

For commit messages I use the article by Chris Beams as reference:

How to Write a Git Commit Message

Step 5: Navigate to main branch

git checkout master

Step 6: Push changes from branch to create a pull request

git push origin <branch-name>

Pull request can be found on github or gitlab (whatever you are using). There you can review and add more comments to it.

That is all!

Got questions? Feel free to reach out via the comments or my twitter

Ok! Now back to learning 👨🏿‍💻

Top comments (0)