Useful Git commands
git push --set-upstream <remote> <branch>
git push origin --delete <name of branch>
If you've been tracking a directory and later decide to ignore the whole directory, simply adding it to .gitignore
isn't enough. First you must add the directory to .gitignore, then run this command:
git rm -r --cached your-directory
Similar to above, but if you've added a .gitignore
with a lot of changes.
git rm -r --cached .
git add .
git commit -m "Message"
git branch new-branch
git reset HEAD~1
git checkout <files>