Skip to content

Instantly share code, notes, and snippets.

@dagezi
Last active August 29, 2015 14:15
Show Gist options
  • Save dagezi/7480b76739eac009865b to your computer and use it in GitHub Desktop.
Save dagezi/7480b76739eac009865b to your computer and use it in GitHub Desktop.
ぐだぐだな branchを gitを駆使して綺麗にする。 ref: http://qiita.com/dagezi/items/2b73743c237f5f4901f7
- A [*] (master trunk)
\- B0 - B1 - B2 (messy_branch)
git checkout messy_branch
git reset master
git add files # stage necessary files!
git commit -m 'squashed!'
git checkout master
git checkout -b refactor_branch
- A (master)
|\- B99 (messy_branch)
\. [*] (refactor_branch)
git checkout -p messy_branch
- A (master)
|\- B99 (messy_branch)
\- C0 [*] (refactor_branch)
git checkout messy_branch
git rebase refactor_branch
- A (master)
\- C0 (refactor_branch)
\- B98 [*] (messy_branch)
- A (master)
\- C0 - C2 - C3 - C1 - C4 (refactor_branch)
\- B95 [*] (messy_branch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment