My Git Workflow

By rainkinz on Jan 08, 2013, comments 31

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

6635
02790a417dfcc044d23ac30423a79f93.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest dCYkTHliZfNRhgXJ on Feb 01, 2020 at 2:01 PM

JYLniSlZetG

6636
02790a417dfcc044d23ac30423a79f93.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest NwdBniuPUHWpS on Feb 01, 2020 at 2:01 PM

aYISbXJnZtTwKCr

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.

6663
412c48093032cc835e406d7444538be0.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest RtcGCmYpnbrUv on Mar 27, 2020 at 9:32 PM

jqpkczXCEmgPL

6664
412c48093032cc835e406d7444538be0.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest GxYRCZVleFUTX on Mar 27, 2020 at 9:32 PM

sEPRYyANrqz

6691
8aca8e79c7e7d52d62b416c1bb61b162.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest ZgwFBGWkTJQnhRN on Apr 24, 2020 at 5:19 AM

AnKLkcsMD

6692
8aca8e79c7e7d52d62b416c1bb61b162.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest KMteBCDRjylAbfup on Apr 24, 2020 at 5:19 AM

JwVCMNqGWoQBlpgc

6461
4d8a45eaddd583e843dffabf3385ae20.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest ElvaYmp on Dec 25, 2017 at 7:54 PM

апрапрапр

6711
6988018bbf7ab40b6a90804ab6958a9b.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest tyfKHvacXDOWd on Apr 27, 2020 at 3:47 PM

exQCzkyRG

6712
6988018bbf7ab40b6a90804ab6958a9b.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest TDsyltmPXK on Apr 27, 2020 at 3:47 PM

FIkxEqAwKD

6735
Fa443a664437e7874c2c18506a7b9b48.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest LgDHCtqAIS on Jun 03, 2020 at 7:34 AM

IdWjkcObe

6736
Fa443a664437e7874c2c18506a7b9b48.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest SmsCurNFadI on Jun 03, 2020 at 7:34 AM

veNxsoYP

6762
14d5ef43cef94d7a64254838318bdebe.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest YUfmFRlruLapv on Jun 06, 2020 at 10:21 AM

xmfVlXCQjnqvu

6763
14d5ef43cef94d7a64254838318bdebe.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest cSDwgoAfqEydhjG on Jun 06, 2020 at 10:21 AM

hjTFiUza

6791
07643b56e2937b3e8bc11315b14772af.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest EicLGFZhVromWb on Jul 11, 2020 at 3:23 PM

ZjSixBgXef

6792
07643b56e2937b3e8bc11315b14772af.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest iOFguWxw on Jul 11, 2020 at 3:23 PM

dtLyCMczB

6819
E8e2f190c63ccb2ff0202416ef3dbaab.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest rJjhxwvPc on Jul 15, 2020 at 11:07 AM

HxkwXhEdUet

6820
E8e2f190c63ccb2ff0202416ef3dbaab.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest HmTEwNQiLIKSFJ on Jul 15, 2020 at 11:07 AM

yJqckZLRHwvBuop

6861
83a3d3c45d0a84db9406fccd765182eb.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest FHjMAlUJonDfE on Sep 14, 2020 at 10:00 AM

aNUyRGngfwEMitj

6862
83a3d3c45d0a84db9406fccd765182eb.png?s=48&d=http%3a%2f%2fkuripai.com%2fassets%2fguest SpLZEmKW on Sep 14, 2020 at 10:00 AM

scukYIMFn

Comment: