Changes between Version 55 and Version 56 of DeveloperGuidelines/Git
- Timestamp:
- 05/18/12 15:18:28 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/Git
v55 v56 122 122 }}} 123 123 124 === Resetting to a previous commit === 124 ==== Rebasing after pushing to GitHub ==== 125 Squash your commits if they are not in between two executions of git pull or git merge is: 126 {{{ 127 # Stash your current work 128 git stash 129 # N = number of commits to squash 130 git reset HEAD@{N} 131 git commit -am 'Your commit message for the one-big-commit' 132 # Push to your branch on GitHub, overwriting any previous code there 133 git push origin +master 134 # Restore your work in-progress 135 git stash pop 136 }}} 137 138 139 140 ==== Resetting to a previous commit ==== 125 141 There are two types of resets soft and hard. 126 142 A soft reset is done like this: … … 142 158 # Force update of GitHub 143 159 git push origin +master 144 }}}145 146 One more method to squash your commits if they are not in between two executions of git pull or git merge is:147 {{{148 git stash149 git reset HEAD@{N}150 git commit -am 'Your commit message for the one-big-commit'151 git push152 git stash pop153 160 }}} 154 161