My Git Workflow

By rainkinz on Jan 08, 2013, comments 12

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: https://github.com/plainblack/Lacuna-Server-Open/wiki/how-to-rebase-your-code

As an alternative you could do this:

git fetch
git rebase origin/master

http://stackoverflow.com/questions/7200614/how-to-merge-remote-master-to-local-branch

5788
F2d7f3aab0e0e5044c7292bc0b5d1231.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest 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...

5937
36d5c27eb9ffac447ecbe80021037470.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest Taran on Jan 06, 2016 at 7:36 PM

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

Comment: