Git pull all branches from a remote repository

Read e.g. this explanation http://git-scm.com/book/en/Git-Branching-Remote-Branches First let’s clarify some git terminology: fetch: getting contents (or updates) from a remote repo pull: fetch (as above) and merge in one step The original poster did not mention merging, so I might guess in proper git terminology he might even have wanted to ask “git fetch all branches … Read more

How do I use Git’s interactive rebase with a local-only repository (no remote / origin)?

git rebase -i in shorthand, without specifying a destination branch, will make git assume that you are trying to rebase against a remote branch tracked by your branch. That’s why the error message is mentioning stuff about remotes. When you do specify a target, git will rebase against that commit-ish: git rebase -i <commit-ish>

git pull all branches from remote repository

Read e.g. this explanation http://git-scm.com/book/en/Git-Branching-Remote-Branches First let’s clarify some git terminology: fetch: getting contents (or updates) from a remote repo pull: fetch (as above) and merge in one step The original poster did not mention merging, so I might guess in proper git terminology he might even have wanted to ask “git fetch all branches … Read more

fatal: The upstream branch of your current branch does not match the name of your current branch

This happens if the name of the upstream branch and local branch do not match, which sometimes happens, and usually is unwanted: > git status On branch release-1.2.3 Your branch is up to date with ‘origin/master’. To solve this, run: git branch –unset-upstream Then, once you run git push again, you will be asked to … Read more

Update a local branch with the changes from a tracked remote branch

You don’t use the : syntax – pull always modifies the currently checked-out branch. Thus: git pull origin my_remote_branch while you have my_local_branch checked out will do what you want. Since you already have the tracking branch set, you don’t even need to specify – you could just do… git pull while you have my_local_branch … Read more

Listing each branch and its last revision’s date in Git

commandlinefu has 2 interesting propositions: for k in $(git branch | perl -pe s/^..//); do echo -e $(git show –pretty=format:”%Cgreen%ci %Cblue%cr%Creset” $k — | head -n 1)\\t$k; done | sort -r or: for k in $(git branch | sed s/^..//); do echo -e $(git log –color=always -1 –pretty=format:”%Cgreen%ci %Cblue%cr%Creset” $k –)\\t”$k”;done | sort That is … Read more

Git: Cannot see new remote branch

First, double check that the branch has been actually pushed remotely, by using the command git ls-remote origin. If the new branch appears in the output, try and give the command git fetch: it should download the branch references from the remote repository. If your remote branch still does not appear, double check (in the … Read more