Git - Useful Commands
git commit --amend --author="My Name <my.name@myname.com>"
git pull
git push
Commit Subfolder to Heroku: git subtree push --prefix <folder> heroku master
View Remote URLs: git remote -v
Remove Git Remote: git remote rm <remote-name>
Find Git Repository URL: git config --get remote.origin.url
Check local status: git status
Reset to latest branch head:
Warning: This command will throw away all your uncommitted changes. For safety, you should always check that the output of git status
is clean (that is, empty) before using it.
git reset --hard
Open Git UI: gitk
Merge branch:
# Start a new feature
git checkout -b new-feature master
# Edit some files
git add <file>
git commit -m "Start a feature"
# Edit some files
git add <file>
git commit -m "Finish a feature"
# Merge in the new-feature branch
git checkout master
git merge new-feature
git push origin master
# Delete the branch
git branch -d new-feature
git merge --no-ff <branch>