Changes between Version 10 and Version 11 of notes/git
- Timestamp:
- 2018-12-05T01:36:09Z (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
notes/git
v10 v11 30 30 }}} 31 31 32 [[br]] 33 32 34 == pull all branches to local 33 35 {{{#!bash … … 37 39 }}} 38 40 41 [[br]] 42 39 43 == pull single branch to local 40 44 `git checkout -t remotes/origin/<branch_name>` 41 45 46 [[br]] 47 42 48 == drop last `n` commits 43 49 `git reset --hard HEAD~n` 50 51 [[br]] 44 52 45 53 == update branch to master and top up unpushed commits … … 47 55 * `git merge master` - merge master commits to selected branch 48 56 57 [[br]] 58 49 59 == edit, reword, squash, fixup, drop last `n` commits 50 60 `git rebase -i HEAD~n` 51 61 62 [[br]] 63 52 64 == grep commit contents 53 65 `git log -p --all -G clean_empty_state` 66 67 [[br]] 68 69 == github enterprise behavior 70 - create a merge commit: 71 - merge all commits from source branch into the middle of target branch; 72 - create merge commit on top of target branch with all source commits as parents; 73 - squash and merge (prefered): 74 - squash all source commits into single commit; 75 - add resulting commit on top of target branch; 76 - rebase ant merge: add all commits from source branch on top of target branch