wiki:GitSkills

Create branch and push to remote

Git 1.7.0+

$ git checkout -b mynewfeature
... edit files, add and commit ...
$ git push -u origin mynewfeature

Via -  http://stackoverflow.com/questions/2765421/how-to-push-a-new-local-branch-to-remote-repo-and-track-it-too

Remove files already in repo

Git keeps tracking the files which were committed to repository before you changed your ".gitignore" files. To ignore these files, you can do by these way:

  1. To ignore one file:
      git rm --cached relativePath/fileName
      git commit -m "commit message"
    
  1. To ignore many files:
      git rm -r --cached .   # to removes everything from the index.
      git add .              # to add all files except the ones which match the rules in ".gitignore" file(s)
      git commit -m ".gitignore is now working"
    

Reference:

GitHub’s collection of .gitignore

 A collection of .gitignore templates - GitHub’s collection of .gitignore file templates for many kinds of projects or languages.

Examples of .gitignore

See Also