User Tools

Site Tools


software:git

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:git [2018/06/21 11:04]
dave
software:git [2018/09/24 14:19] (current)
dave
Line 54: Line 54:
 <​code>​ <​code>​
 git diff <​rev1>​^..<​rev2>​ git diff <​rev1>​^..<​rev2>​
 +</​code>​
 +
 +==== Merge Squash == 
 +
 +<​code>​
 +git merge --squash <​other_branch>​
 +</​code>​
 +
 +Applies all of the changes made to ''<​other_branch>''​ to the working copy as a single set of //staged// changes which is ready to be committed. ​ Use ''​git commit''​ as per usual.
 +
 +==== List Remote Branches ==
 +
 +After initially cloning a repository, git is only aware of the the default branch, which is usually ''​master''​.
 +
 +<​code>​
 +$git branch
 +* master
 +</​code>​
 +
 +Use ''​-a''​ to list remote branches:
 +
 +<​code>​
 +$git branch -a
 +* master
 +remotes/​origin/​HEAD -> origin/​master
 +remotes/​origin/​release
 +</​code>​
 +
 +===== Misc Tasks ==
 +
 +==== Show only the files that are modified as a commit ==
 +
 +This removes the diff lines from the ''​show''​ command (''​+''/''​-''​ lines):
 +
 +<​code>​
 +$git show <​hash>​ --name-only
 </​code>​ </​code>​
  
software/git.1529604278.txt.gz ยท Last modified: 2018/06/21 11:04 by dave