aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cheatsheet.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/cheatsheet.txt b/cheatsheet.txt
index 72727dc..0f38214 100644
--- a/cheatsheet.txt
+++ b/cheatsheet.txt
@@ -1,3 +1,9 @@
+Global Setup
+
+ See also Submodules below.
+
+ git config --global color.status.branch red
+
Tag
git tag -a x.y.z -m "Tag version x.y.z"
@@ -21,7 +27,7 @@ Copy commit from one branch to the other
# On the source branch
git log -1
git cout <target-branch>
- git cherry-pick <commit-id>
+ git cherry-pick <commit-id>
Setup remote repository
@@ -67,9 +73,9 @@ Delete a branch from a remote repository
Rebasing
Local (e.g., from a feature branch to master):
-
+
git rebase <src> [<dst>]
-
+
If <dst> is not specified, current branch is used. If <dst> is
specified, it is checked out.
@@ -128,7 +134,7 @@ History Cleanup
didn't record the resolutions. And in this case what you would have
gotten is a normal merge conflict, just like the first time, that
you have to resolve manually again.
-
+
Running 'git stat' should give you the idea of what needs fixing. Once
you have edit the files, run 'git add' and then 'git rebase --continue'.
@@ -161,7 +167,7 @@ History Cleanup
and count the number of commits from the top to the first commit that
is on master (and if you know a better way to achieve the same result,
let me know). That is your <N>.
-
+
Note also that the order of commits in the resulting edit file will
be the reverse of what you see in gitk.
@@ -181,7 +187,7 @@ History Cleanup
Verify with gitk everything looks good on master and push:
git push
-
+
It is also a good idea to delete the feature branch, both locally
and on the origin:
@@ -211,7 +217,7 @@ Submodules
git submodule update --remote [sub] # update submodule(s) (to remote master)
# --rebase
-
+
git fetch
git checkout <commit-sha1> # As above but to specific commit.