[git-users] Re: checking out remote branches. problem I haven't read about yet
On Tuesday, May 21, 2013 9:22:01 PM UTC+2, ks...@kendallshaw.com wrote: Hi, I am trying to use a repository being served at my work, by me. If I: git ls-remote It shows the branches that I expect, e.g.: ... refs/remotes/floop git branch -a shows: * master remotes/origin/HEAD - origin/master remotes/origin/master git branch -r show: origin/HEAD - origin/master origin/master This produces an error message: git checkout -b noo origin/floop Fatal: Cannot update paths and switch to branch 'noo' at the same time. So, after that I've tried things I've read about but don't understand, like: git remote update git fetch I get the same error message when trying to checkout the branch. git remote add woof https://example.com/arf.git git fetch woof git checkout -b noo woo/floop Produces the same error message. git branch -a now also shows remotes/woof/master and nothing else new. Can you tell what the problem is? It appears you are trying to check out a remote branch that does not exist. If the remote repository 'origin' did have a branch called 'woof', it should appear in the output when you do git branch -r. If the branch has been added after you last fetched, you'll have to do another git fetch origin first to sync the remote. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] Re: checking out remote branches. problem I haven't read about yet
On Tuesday, May 21, 2013 12:22:01 PM UTC-7, que...@gmail.com wrote: Hi, I am trying to use a repository being served at my work, by me. If I: git ls-remote It shows the branches that I expect, e.g.: ... refs/remotes/floop git branch -a shows: * master remotes/origin/HEAD - origin/master remotes/origin/master git branch -r show: origin/HEAD - origin/master origin/master This produces an error message: git checkout -b noo origin/floop Fatal: Cannot update paths and switch to branch 'noo' at the same time. So, after that I've tried things I've read about but don't understand, like: git remote update git fetch I get the same error message when trying to checkout the branch. git remote add woof https://example.com/arf.git git fetch woof git checkout -b noo woo/floop Produces the same error message. git branch -a now also shows remotes/woof/master and nothing else new. Can you tell what the problem is? Someone on #git gave me a solution. I don't understand it though. The solution was to use a refspec to copy a path from the remote repository. The added remote woof was used. I'm not sure if that is significant or not. git fetch woof +refs/remotes/*:refs/woof/remotes/* The result is that commands now recognize a path starting with woof, e.g.: woof/floop The rest of the error message I was getting was: Did you intend to checkout 'woof/floop' which can not be resolved as commit? Resolved as commit is refers to the type of git object that is called a commit. So, the message means that it doesn't recognize the path woof/floop. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.