Version Control Routine

Make version control part of your daily routine.
Whether you are working with dedicated focus in a single repository or switching between several repositories while jumping from task-to-task, a personal discipline of frequent and small commits will bring
Rinse and Repeat 🕗
-
Prep for Work
As you sit down to start your work, make sure your repository is up-to-date with any changes since you’ve last seen it. This is vital if you are working as part of a team. It also helps you if you are a solo-developer.
git status
(and cleanup, if any)git pull
for latest changes
The goal is to make sure any recent work from the remote repository is downloaded to your local computer.
-
Work
You write code. You create documentation (preferably in markdown). If you love yourself, you even write automated tests!
Whatever it is you are doing, you will hit points where you have completed some task, however small. That’s a milestone. It’s also a good time to commit your work.
git status
to see what’s been happening in your working directorygit add .
to stage changesgit commit -m "Your Comment"
-
Wrap Up
You don’t have to do a
git push
every time you commit. You can build up several commits before you send them up to the remote repository. As a rule of thumb, however, you should never end the day without having pushed at least once.git pull
because you should see if any of your team have contributed to the code basegit push
to share the work you’ve done for the day
The combination of push and pull is how you synchronize your work.

Are you done for the day? Then enjoy a good night’s sleep, and remember to start the routine again the next day!