Git Rebase Workflow Reference Sheet

A. Create Topic Branch

  1. git checkout parentbranch
  2. git pull
  3. git checkout -b topicbranch

B. Commit Code Modifications

  1. git add file.txt
  2. git commit

C. Rebase onto Parent Branch

  1. git checkout parentbranch
  2. git pull
  3. git checkout topicbranch
  4. git rebase parentbranch

D. Resolve Rebase Conflicts

  1. Manually resolve conflicts.
  2. git add file.txt
  3. Note: Use git checkout -m file.txt to revert file to unmerged state.

    Note: Use git rebase --abort to abandon rebase.

  4. git rebase --continue

E. Merge Topic Branch into Parent Branch

  1. git checkout parentbranch
  2. git pull
  3. git checkout topicbranch
  4. git rebase parentbranch
  5. git checkout parentbranch
  6. git merge topicbranch
  7. git push
  8. git branch -d topicbranch
Advertisements

2 Responses to “Git Rebase Workflow Reference Sheet”

  1. […] Git Rebase Workflow Reference Sheet […]

  2. Thanks old Pal, I know this one goes out to me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: