Last active
April 28, 2016 08:17
-
-
Save madhikarma/6dd917a3f5b247463a59 to your computer and use it in GitHub Desktop.
Git cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Clone | |
git clone <some_repo_url> | |
#### Branch | |
git branch <branch_name> | |
#### Checkout | |
git checkout <branch_name> | |
#### Commit | |
git commit -m <commit message here> | |
#### Push | |
git push origin <branch_name> | |
#### Checkout & Branch | |
git checkout -b <branch_name> | |
#### Pushing Tags | |
git push --tags | |
#### Rebase (dangerous) | |
git pull --rebase | |
#### Fetch | |
git fetch -p | |
#### Submodules | |
git submodule deinit <submodule_name> | |
git rm <submodule_name> | |
git rm --cached <submodule_name> | |
rm -rf .git/modules/<submodule_name> | |
#### Remove DS_Store files already in the repo | |
If you dont have an ignore file create one in a text editor or on the command line | |
touch .gitignore | |
and save it to project root | |
Then edit the file and add the following line | |
#### Add DS_Store files to gitignore file | |
.DS_Store |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment