Convention: %H : commit hash %h : abbreviated commit hash How to how logs of one given file git log --pretty=oneline file name How to show just the file names changed in a patch? git show %H --name-only How to do a git squash? e.g. If I want to squash the two commits on HEAD. (a) git rebase -i HEAD~2 git will bring all a editor with the following message: pick 8157e2b Test 1. pick 05532ed Test 2. (b) change the second 'pick' to 'squash', which means squash commit 2 (Test2) into commit 1 (Test1) (c) Save and quite. git will combine the two commits together and bring up a new editor. Like: # This is a combination of 2 commits. # The first commit's message is: Test 1. # This is the 2nd commit message: Test 2. Edit the message again and save and quite. Like Test1 && Test2 Successfully rebased and updated refs/heads/master. If you do a 'git log' after the combination, you will find the new combin...
Comments
Post a Comment