Useful commands

Here is a list of most useful GIT commands for me when working with projects on github.

Get latest changes from origin:

git pull / git pull origin

Update fork on github:

git push myfork

Create new branch:

git branch mybranch / git checkout -b mybranch

Update branch on github:

git push myfork mybranch

Rebase branch to master:

git checkout mybranch
git rebase master

Remove branch:

git branch -d mybranch
git push myfork :mybranch

Git tfs:

Clone TFS repository:

git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project

Get latest version:

git tfs pull

Checkin commits to TFS:

git tfs ct

Git tfs with branches:

Clone TFS repository with branches:

git tfs clone --with-branches http://tfs:8080/tfs/DefaultCollection $/some_project

Git bundles:

Create bundle:

git bundle create repo.bundle master

Create bundle from last 10 days:

git bundle create repo.bundle --since=10.days master

Create repository from bundle:

git clone repo.bundle -b master repo

Verify the bundle:

git bundle verify repo.bundle

Pull from the bundle:

git pull repo.bundle master