Re: [RFC/PATCH 2/3] pull: trivial cleanups
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- May 16, 2013, 09:54 UTC
- Message-ID
- <CALkWK0kP1yhdhV7oLA4gYJTJ7VtU2WuhtJ_Q5UsZSS00y=FP_w@mail.gmail.com>
- In-Reply-To
- <CAMP44s1vMTfrSaU+0S8EOM5g4L0885780SvT_THBr7u==bJ06A@mail.gmail.com>
Felipe Contreras wrote:
> % git fetch origin 'refs/tags/*:refs/tags/*' 'refs/heads/*:refs/heads/*' > fatal: Refusing to fetch into current branch > refs/heads/fc/fast-export/cleanup of non-bare repository > fatal: The remote end hung up unexpectedly
That's because your HEAD is pointing to something under refs/heads/*: it would work otherwise. When I'm developing on my personal branch, I sometimes do 'git fetch origin master:master +pu:pu +next:next', and it works as expected. When on master branch, I can't git fetch origin master:master and this is a cute safety feature.
Either way, I think it's a bad practice to fetch directly into refs/heads/*: you should really be fetching to refs/remotes and then merging your changes in. I do want shortcuts though, which is why I'm interested in fixing pull: there is nothing to fix in fetch as far as I'm concerned.