User Tools

Site Tools


git_tips

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

git_tips [2014/07/21 03:11]
freaktechnik [Skip CI build]
git_tips [2015/02/19 12:10] (current)
freaktechnik alternative squashing method.
Line 15: Line 15:
   git commit   git commit
   git push origin my-branch -f   git push origin my-branch -f
 +  ​
 +===== Alternative Method =====
 +  git rebase -i HEAD~2
 +  git push
 +
 +Replace 2 with the number of commits backwards from where you are you want to include in your possible squashing. The -i flag allows you to pick what to do with each commit. If you've already pushed the commit to squash to the main repo, you shouldn'​t squash it in the first place, as it will mess up other people'​s local copies. If you've already pushed a squashed commit to a personal remote, you will have to force push the changes to your remote, as the commit has disappeared and a new one was added in its place.
  
 ====== Rebase instead of merge ====== ====== Rebase instead of merge ======
git_tips.txt ยท Last modified: 2015/02/19 12:10 by freaktechnik