Git: Difference between revisions
| (9 intermediate revisions by the same user not shown) | |||
| Line 52: | Line 52: | ||
Congratulations! You've just thrown away any local work. | Congratulations! You've just thrown away any local work. | ||
===Remove local+remote tag=== | |||
* <tt>git tag -d TAG</tt> | |||
* <tt>git push --delete origin TAG</tt> | |||
===Rename local+remote branch=== | |||
Remote branches cannot be renamed in a single step. Instead, | |||
* Check out the remote branch if it is not checked out | |||
* Rename the local branch with <tt>git branch -m newname</tt> | |||
* Delete the remote branch with <tt>git push origin ––delete oldname</tt> | |||
* Re-add and reset the remote branch with <tt>git push origin –u newname</tt> | |||
===Find commit corresponding to tag=== | |||
* <tt>git rev-list -n 1 TAG</tt> | |||
===List all commits between two hashes Ce and Cb=== | |||
* <tt>git rev-list Ce..Cb</tt> | |||
===Update local list of remote branches=== | |||
* <tt>git remote update origin --prune</tt> | |||
===Change base branch BBase of branch Bbranch to BNewbase=== | |||
* <tt>git rebase --onto BNewbase BBase Bbranch</tt> | |||
===Show changes in commit C, even if it's a merge commit=== | |||
* <tt>git show --diff-merges=on C</tt> | |||
===List remote tags=== | |||
* <tt>git ls-remote --tags remotename</tt> | |||
==See also== | |||
* [[GitHub]] | |||
==Links== | ==Links== | ||