Oops! I committed and pushed some crap that I didn't mean to.
git rm -r --cached some-directory
git commit -m 'Remove the now ignored directory "some-directory"'
git push origin master
Ever have a build folder that you need to deploy to another repo? Use git subtree split
!
In this example, I am grabbing my build
folder, splitting it, and pushing it to my gh-pages
branch. Caution: This will completely overwrite what is already in the gh-pages branch
git subtree split --prefix build -b gh-pages-temp
git push -f origin gh-pages-temp:gh-pages
git branch -D gh-pages-temp
More info: One line deployment to GH pages
If you updated a file that already existed and want to remove it from the PR:
Assume you're working on a branch off of staging, and you PR'd a file named validate_model.py
.
To remove this file from the PR and revert its changes, simply do:
git checkout staging -- validate_model.py
and then re-commit and push upstream.
This actually creates and checks out a new branch.
git checkout -b {branch name}
git push -u origin <new local branch>
git branch -a
- lists all branched
git remote show origin
- lists
See: https://help.github.com/articles/changing-a-remote-s-url/
git remote -v
- show all remote paths
git remote set-url origin {ssh path to origin gh repo}
- set url for origin
git remote set-url upstream {ssh path to upstream gh repo}
- set url for upstream
See: https://help.github.com/articles/configuring-a-remote-for-a-fork/
git remote add upstream {ssh path to remote gh repo}