$ echo 'out/' >> .gitignore
$ git rm -r --cached out/
$ git reset HEAD
$ git create branch newfeature
$ git checkout newfeature
$ git add -A .
$ git commit -m "shelving partially working copy for new feature"
$ git checkout master
git branch newfeature
// reset to previous commit
git reset --hard HEAD^
- Get all remote branches
git branch -a
* master
remotes/origin/HEAD
remotes/origin/master
remotes/origin/experimental
- To checkout the changes
git checkout origin/experimental
- To track the changes, you need to create a local branch
git branch -b experimental origin/experimental
- Now you can look both branches
git branch
*experimental
master
- To remove untracked files
git clean
git clean -f // clean.requireForce is not set to false, default is true
- To clean directory (do after removing the file)
git clean -d -f
- To clean the files from
.gitignore
git clean -X -f
git upstream pull
git checkout -b newbranch upstream/master
Reference: http://stackoverflow.com/questions/4410091/github-import-upstream-branch-into-fork
git push -u origin mynewfeature
git checkout -b <newbranch> <tagname>
# example
git checkout -b hotfix-v2 tag-v2
push -v --tags --set-upstream production release-ver-0.3.002:master
git tag -a <tag-name> -m <message>'
# example
git tag -a v1.2 -m 'version 1.2'
git push <remote-name> <tag-name>
# example
git push origin v1.2
git tag --force v1.2
# example
git tag --force v1.2
git push --force <remote-name> <tag-name>
# example
git push --force origin v1.2
git commit --allow-empty -m "empty commit"
git push heroku master