Hexa's Blog

Git - cheatsheet

05/12/2014 cheatsheet

1. Untrack an already check-in directory or file

git rm -r --cached folder_name

-r : recursive
–cached: files or directories are only deleted on the git’s index, not on local storage.

2. See all submodules

cat .gitmodules

3. Add a submodule

git submodule add url_of_submodule

4. Initialize all submodules

git submodule init

5. Reset stage to the last commit

git reset --hard HEAD

6.Clone repository with a particular folder name

git clone git@github.com:whatever folder-name