Closed chucklu closed 7 years ago
Hi Chuck,
A recent thread on the main Git list covered a related problem "cloning a repository with a default MASTER branch tries to check out the master branch" for an unborn branch at the remote.
Ther thread goes on to say how to change the reference HEAD at the remote so that you get the one you want (the checkout of 'master' is because it is teh default branch name when Git can't find the (branch) ref that matches the HEAD sha1 value).
https://public-inbox.org/git/?q=
https://public-inbox.org/git/xmqqshjtg1kh.fsf@gitster.mtv.corp.google.com/T/#u
Philip ----- Original Message ----- From: Chuck Lu To: git-for-windows/git Cc: Subscribed Sent: Friday, May 26, 2017 6:56 AM Subject: [git-for-windows/git] How can I sync the remotes/origin/HEAD (#1180)
Setup a.. Which version of Git for Windows are you using? Is it 32-bit or 64-bit? $ git --version --build-options
git version 2.13.0.windows.1 built from commit: eba7af3dbb4c846c6303c5f64102acee696c9ab0 sizeof-long: 4 machine: x86_64
a.. Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit? $ cmd.exe /c ver
Microsoft Windows [Version 10.0.10586] a.. What options did you set as part of the installation? Or did you choose the defaults?
type "C:\Program Files\Git\etc\install-options.txt" type "C:\Program Files (x86)\Git\etc\install-options.txt" type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt" $ cat /etc/install-options.txt
Path Option: Cmd SSH Option: OpenSSH CURL Option: WinSSL CRLF Option: CRLFAlways Bash Terminal Option: MinTTY Performance Tweaks FSCache: Enabled Use Credential Manager: Disabled Enable Symlinks: Disabled
Details a.. Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other Bash
a.. What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
a.. What did you expect to occur after running these commands? sync the remote head of origin,the remote head should point to develop
a.. What actually happened instead?
the remote head still point to master
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Closing this ticket, as the Git mailing list is really a better forum to discuss this question than Git for Windows' bug tracker. (The question does not suggest that there is a bug in Git for Windows.)
@PhilipOakley When I delete a remote branch(test) on git server,after git fetch --all. My local repository still keep the branch(origin/test) in background
@chucklu yes, that is correct. Git is careful to avoid deleting things you did not explicitly ask to do.
The whole idea of a 'remote' is that it (the origin machine) is an independent server. However the copy that held within your localmachine is a separate item. It is easy to confuse the thing termed 'remote' that is actually your local copy, and the other thing 'remote' that is the distant server.
So you have deleted the branch on the distant server, but you still have a copy locally. When you ask to fetch --all, the other branches are updated (depending on your refspec - see git help revisions
) but there is no response from the distant server about the now missing branch, so the local git leaves the data in place.
As dscho noted, it is (IIUC) working correctly, so it' not an issue for the bug tracker.
Setup
Details
Bash
sync the remote head of origin,the remote head should point to develop
the remote head still point to master