git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Switching branches not working in a cloned repo

From
Philip Oakley <philipoakley@iee.org>
Date
Sep 19, 2016, 16:16 UTC
Message-ID
<3999677D12354A3CB2035E932353981A@PhilipOakley>
In-Reply-To
<YQXPR01MB0023CDCFA27BDD4959B4F9B19EF40@YQXPR01MB0023.CANPRD01.PROD.OUTLOOK.COM>
From: "Paul Williamson" <paul.williamson@mediamiser.com>
Show 11 quoted lines
> Hi,
>
> We use git extensively on a number of repos. Recently, we have had a 
> problem with one of them. This repo has a 'web_dev' branch. For copies of 
> the repo cloned before a certain (recent but unidentified) time, we could 
> 'git checkout' between master and web_dev and everything would be normal.
>
> However, now if we clone the repo, we can no longer do 'git checkout 
> web_dev'. Git doesn't complain, in fact there is no feedback and we are 
> still in the master branch. Running 'git branch -r' still shows the branch 
> as existing at origin.
Have you tried `git ls-remote` ?
The `branch -r` just lists the local 'rtb's (IIUC).

It could be someone has accidently pruned or deleted that branch at the remote.

What version are you (they) on?
Show 18 quoted lines
>
> If we try 'git branch web_dev' we then see web_dev listed locally and can 
> switch to it BUT on closer inspection we realise that this action has 
> created a new branch off master.
>
> The first time we saw this was under Bash on Windows, so we thought maybe 
> it was a beta problem, but a) other repos work as expected under that 
> environment, and b) under cygwin, pulling the same repo to a new directory 
> alongside an older copy shows that the problem occurs with the new clone, 
> but not the one that that was cloned longer ago.
>
> Also in this situation, there are no local outstanding code changes that 
> might cause problems switching branches. This occurs right from a cleanly 
> cloned repo.
>
> It seems something has gone wrong with this repo, and we don't know what. 
> It's a tough problem to google, and I was not able to search the gmane 
> archives (DNS errors).
Gmane had to quit. Try http://public-inbox.org/git (see the help link)
Show 5 quoted lines
>
> Any idea how to investigate?
>
> Thanks,
> Paul

-- philip

Previous: Paul WilliamsonNext: Paul Williamson
Message 2 of 5 in “Switching branches not working in a cloned repo”
  1. Paul WilliamsonSep 19, 2016
  2. Philip OakleySep 19, 2016
  3. Paul WilliamsonSep 19, 2016
  4. Jacob KellerSep 19, 2016
  5. Paul WilliamsonSep 19, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.