I don't get the difference between git rebase origin
and git rebase origin/master
. In my case I cloned a git repository twice. In the first clone I have to use git rebase origin
and in the other clone I must use git rebase origin/master
.
An example: http://paste.dennis-boldt.de/2011/05/11/git-rebase
git rebase origin
means "rebase from the tracking branch oforigin
", whilegit rebase origin/master
means "rebase from the branchmaster
oforigin
"You must have a tracking branch in
~/Desktop/test
, which means thatgit rebase origin
knows which branch oforigin
to rebase with. If no tracking branch exists (in the case of~/Desktop/fallstudie
), git doesn't know which branch oforigin
it must take, and fails.To fix this, you can make the branch track
origin/master
with:Or, if
master
isn't the currently checked-out branch:Here's a better option:
From the documentation:
This has actually been around quite a while (since v1.6.3); not sure how I missed it!
You can make a new file under [.git\refs\remotes\origin] with name "HEAD" and put content "ref: refs/remotes/origin/master" to it. This should solve your problem.
It seems that clone from an empty repos will lead to this. Maybe the empty repos do not have HEAD because no commit object exist.
You can use the
to see the difference between each repository, while the "problem" one do not have "origin/HEAD"
Edit: Give a way using command line
You can also use git command line to do this, they have the same result