try to make w3 validator happy
[wiki.git] / git.mdwn
index 4cc057709ba617febb097578da710567d9422433..d18141088b09af6ec51d73afeb14bda04eb6673b 100644 (file)
--- a/git.mdwn
+++ b/git.mdwn
@@ -2,12 +2,30 @@
 
 ## Howto
 
+### How to undo/revert your last commit 
+
+    git reset --soft HEAD^
+
 ### How to tell which files git is tracking
 
     git ls-files
 
+### How to get the short sha1 for a commit
+
+    git log --oneline
+
 See also http://stackoverflow.com/questions/2405305/git-how-to-tell-if-a-file-is-git-tracked-by-shell-exit-code
 
+### How to use git stash
+
+Undo your changes, show your stashes, and re-apply them
+
+    git stash
+    git stash list
+    git stash apply
+
+http://git-scm.com/book/en/Git-Tools-Stashing
+
 ### Fix your email address in your commits
 
 https://help.github.com/articles/changing-author-info
@@ -27,4 +45,30 @@ Once your submodules are all set...
 
 http://chrisjean.com/2009/04/20/git-submodules-adding-using-removing-and-updating/
 
+#### Remove a git submodule
+
+> To remove a submodule you need to:
+> 
+> 1. Delete the relevant line from the ''.gitmodules'' file.
+> 1. Delete the relevant section from ''.git/config''.
+> 1. Run ''git rm --cached path_to_submodule'' (no trailing slash).
+> 1. Commit the superproject.
+> 1. Delete the now untracked submodule files.
+> 
+> -- https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial
+
+## Learning git
+
+http://pcottle.github.io/learnGitBranching/?NODEMO
+
+http://think-like-a-git.net
+
+http://try.github.io/levels/1/challenges/1
+
+https://github.com/gazler/githug
+
+## fast forward
+
+http://nathaniel.themccallums.org/2010/10/18/using-git-fast-forward-merging-to-keep-branches-in-sync/
 
+http://365git.tumblr.com/post/504140728/fast-forward-merge
\ No newline at end of file