On Thu, 2007-10-18 at 17:14 +0200, Steffen Prohaska wrote: > On Oct 18, 2007, at 4:50 PM, Joakim Tjernlund wrote: > > > > > I thougth I could create a new branch on the server using: > > > > # > git push ssh://devsrv/var/git/os2kernel.git linus:refs/linus > > Warning: No xauth data; using fake authentication data for X11 > > forwarding. > > updating 'refs/linus' using 'refs/heads/linus' > > from 0000000000000000000000000000000000000000 > > to bbf25010f1a6b761914430f5fca081ec8c7accd1 > > Generating pack... > > Done counting 0 objects. > > Writing 0 objects... > > Total 0 (delta 0), reused 0 (delta 0) > > error: refusing to create funny ref 'refs/linus' locally > > ng refs/linus funny refname > > error: failed to push to 'ssh://devsrv/var/git/os2kernel.git' > > > > but that doesn't work. Am I doing this wrong? > > Include 'heads' in your remote refspec: > > git push ssh://devsrv/var/git/os2kernel.git linus:refs/heads/linus Now the push went OK: git push ssh://devsrv/var/git/os2kernel.git linus:refs/head/linus Warning: No xauth data; using fake authentication data for X11 forwarding. updating 'refs/head/linus' using 'refs/heads/linus' from 0000000000000000000000000000000000000000 to bbf25010f1a6b761914430f5fca081ec8c7accd1 Generating pack... Done counting 0 objects. Writing 0 objects... Total 0 (delta 0), reused 0 (delta 0) refs/head/linus: 0000000000000000000000000000000000000000 -> bbf25010f1a6b761914430f5fca081ec8c7accd1 but there is no linus branch in the server repo! However: git push ssh://devsrv/var/git/os2kernel.git linus creates a linus branch in the server and git push ssh://devsrv/var/git/os2kernel.git :linus Warning: No xauth data; using fake authentication data for X11 forwarding. deleting 'refs/heads/linus' refs/heads/linus: bbf25010f1a6b761914430f5fca081ec8c7accd1 -> deleted Everything up-to-date deletes the linus branch on the server and so does git push ssh://devsrv/var/git/os2kernel.git :refs/heads/linus ahh, now I see. When creating the branch the refspec needs to be refs/heads/linus, not refs/head/linus refs/head/linus will create just that on the server. git branch does not look there, only in refs/heads Seems like it is a bit too easy to make mistakes here. Why can I delete a branch with :linus but not create one with linus:linus? Also confusing that git lets me create refs/head/linus when git branch cannot find it. Jocke > You may need to cleanup though. I'm not sure if the remote side > already created 'refs/linus'. The error message only indicates that > locally git refused to create the "funny refname". Pushing a refspec > with an empty local part should delete the "funny refname" on the > remote: > > git push ssh://devsrv/var/git/os2kernel.git :refs/linus > > Did this solve your problem? > > Steffen > - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html