- Fork repository
- git clone [fork]
- git remote add upstream [master]
git remote -v
git remote add [remote name] https://github.com/user/repo.git
git remote rm [remote name]
git remote set-url origin [ssh-key]
git checkout -b [branch-name]
git checkout [branch-name]
git branch -D [branch-name]
Create and delete branches on Github.
http://stackoverflow.com/questions/1338728/delete-commits-from-a-branch-in-git
git branch --list
git push [remote-name] [branch-name]
####Push and create branch on remote
git push -u [remote-name] [branch-name]
git merge [branch-name]
git reset --hard
git clean -fd
Check what would be deleted
git clean -n
Delete items
git clean -f
For a specific file use:
git checkout path/to/file/to/revert
For all unstaged files use:
```bash
git checkout -- .
git clean -fdx --
-f - force
-d - directories too
-x - remove ignored files too ( don't use this if you don't want to remove ignored files)
git reset --hard [tag/branch/commit id]
git stash
git stash pop
The first stash hides away your changes (basically making a temporary commit), and the subsequent stash pop re-applies them. This lets git use its merge capabilities.
fixes #[issue number] into a commit message
git tag [tag(v1.0.0)]
git push origin [tag]
git tag
git push origin --tags
git pull --rebase [remote branch]
git pull origin [remote branch]
git cherry-pick [commit id]
git add [directory] && git commit -m "Initial [name of solution] subtree commit"
git subtree push --prefix [directory] [branch (typically origin or upstream)] gh-pages