My Git Workflow

By rainkinz on Jan 08, 2013, comments 17

I found it took me a little time to find a workflow I like with git. This is what I've settled on for now:

  • Branch
git checkout -b some_topic
  • Make some changes to some_topic branch.
  • Notice that master has been updated.
  • Make sure my changes have been committed in some_topic branch.
  • Checkout master and pull the latest changes:
git checkout master
git pull
  • Rebase those changes into the some_topic branch:
git checkout some_topic
git rebase master
  • Optionally make more changes on the some_topic branch:
  • Merge some_topic into master:
git checkout master
git pull
git merge some_topic

Check this out too:

As an alternative you could do this:

git fetch
git rebase origin/master

02790a417dfcc044d23ac30423a79f93.png?s=48& dCYkTHliZfNRhgXJ on Feb 01, 2020 at 2:01 PM


02790a417dfcc044d23ac30423a79f93.png?s=48& NwdBniuPUHWpS on Feb 01, 2020 at 2:01 PM


F2d7f3aab0e0e5044c7292bc0b5d1231.png?s=48& Anele on Sep 11, 2015 at 9:03 PM

come from. Before you do the checkout, do git refolgYou will see a list of all recent actions in your repository, including the last good commit, which you happened to delete. The list looks like this:ba9a974... HEAD@{0}: commit: commit_message391c84e... HEAD@{1}: commit: commit_message0145b2f... HEAD@{2}: commit: commit_messageNow choose the one HEAD you would like to restore and do the checkout. You are now good to go and to do the merge...

36d5c27eb9ffac447ecbe80021037470.png?s=48& Taran on Jan 06, 2016 at 7:36 PM

This is way more helpful than anynhitg else I've looked at.

412c48093032cc835e406d7444538be0.png?s=48& RtcGCmYpnbrUv on Mar 27, 2020 at 9:32 PM


412c48093032cc835e406d7444538be0.png?s=48& GxYRCZVleFUTX on Mar 27, 2020 at 9:32 PM


4d8a45eaddd583e843dffabf3385ae20.png?s=48& ElvaYmp on Dec 25, 2017 at 7:54 PM