"git redirect source" vs. "git rebase origin / master"

I don't understand the difference between git rebase origin and git rebase origin/master . In my case, I cloned the git repository twice. In the first clone I have to use git rebase origin , and in the other clone I have to use git rebase origin/master .

Example: http://paste.dennis-boldt.de/2011/05/11/git-rebase

+43
git git-rebase
May 11 '11 at 11:39
source share
3 answers

Here's the best option:

 git remote set-head -a origin 

From the documentation:

With -a, the console is requested to determine its HEAD, then $ GIT_DIR / remotes // HEAD is installed in one branch. for example, if the remote HEAD is indicated on the following, “git remote job-head-aa” will set $ GIT_DIR / refs / remotes / origin / HEAD to refs / remotes / origin / next. This will only work if refs / remotes / origin / next already exists; if it should not be selected first.

It really has been quite a long time (since version 1.6.3); don't know how i missed this!

+19
May 13 '11 at
source share
— -

git rebase origin means "rebase from branch tracking origin ", and git rebase origin/master means "rebase from branch master of origin "

You should have a tracking branch in ~/Desktop/test , which means that git rebase origin knows which origin branch needs to be reinstalled. If the tracking branch does not exist (in the case of ~/Desktop/fallstudie ), git does not know which origin branch it should accept and is not running.

To fix this, you can make an existing master origin/master branch track using

 git branch --set-upstream master origin/master 
+47
May 11 '11 at 13:02
source share

You can create a new file under [.git \ refs \ remotes \ origin] with the name "HEAD" and put the contents of "ref: refs / remotes / origin / master" in it. This should solve your problem.

It seems that a clone from an empty repo will lead to this. Perhaps there is no HEAD in empty repositories because there is no commit object.

you can use

git log --remotes --branches --oneline --decorate

to see the difference between each repository, while the “problem” does not have “origin / HEAD”

Edit: specify how to use the command line
You can also use git command line, they have the same result

git symbolic-ref refs / remotes / origin / HEAD refs / remotes / origin / master

+2
May 11, '11 at 15:12
source share



All Articles