{"thread":{"id":"13741","subject":"unable to push","startedAt":"2008-05-31T15:03:47Z","lastAt":"2008-06-01T18:36:59Z","messageCount":11,"participants":["david@lang.hm","Jeff King","Adam Piątyszek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"78232","messageId":"alpine.DEB.1.10.0805310759540.15294@asgard.lang.hm","threadId":"13741","inReplyTo":null,"subject":"unable to push","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-05-31T15:03:47Z","receivedAt":"2008-05-31T15:03:47Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"for some reason when I try to push to my public repo I get a message that \neverything is up to date, but if I switch to that repo and do a pull it \nupdates properly\n\nI tried recreating the public repo the last time this happened, but it \nlooks like when I do git am followed by git revert --hard HEAD^ (to fix \nthe patch) followed by git am it breaks again.\n\nDavid Lang\n\nroot@asgard:/var/www/adastra/xml2pdf/current# git push public\nroot@asgard's password:\nEverything up-to-date\nroot@asgard:/var/www/adastra/xml2pdf/current# git ls-remote public\nroot@asgard's password:\nd3f3d8474db1c006a53be8b5f5c1a0d866d7e357        HEAD\nd3f3d8474db1c006a53be8b5f5c1a0d866d7e357        refs/heads/localmaster\nd3f3d8474db1c006a53be8b5f5c1a0d866d7e357        refs/remotes/origin/master\n7fcb26098cb3885f8b553b052ca3c3dfef3a508b        refs/tags/1.5.1\n73580be6e04cf2e106c70ab352a94e2bfd5faeb6        refs/tags/1.5.10\n85fe03cb12f795c2b40239d0e656de63eb7c81d7        refs/tags/1.5.11\n469a1473911289b9a60c069094113bb9ef97a0f8        refs/tags/1.5.12\n94bc2757622ccfd3668dd9b505d623893e37efbe        refs/tags/1.6.0\n5aef76575a993d51f0ae628b36964c37cd26a7c3        refs/tags/1.7.0\n0141ecaa92a34aac63fb2c0689683eb1a701dca3        refs/tags/1.7.1\nd5d7d1962bdb8d5f7444696cb4ea07d6a6ab8d9e        refs/tags/1.7.2\n2a844908229621f9c31ccb5b33d8907abeb64b36        refs/tags/1.7.4\n8c07c4666d6e9eb88f0197416a38f841cf2c9b9d        refs/tags/1.7.6\n046968a4fa5767db9387e940d5138ac10391020f        refs/tags/1.8.0\nec48db4ecacda648333596ef17ce8a0a588645a8        refs/tags/1.8.1\nad7c88741bf2631eca9c3d24721b1bd8ec4a4793        refs/tags/1.8.2\nbe0f3ccd11f5064b40f089b62152b820fb3aaf6f        refs/tags/1.8.3\nroot@asgard:/var/www/adastra/xml2pdf/current# git ls-remote .\n71ab4eea48eb3407a2ff4eef2befe9251897d676        HEAD\n71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/heads/master\n7fcb26098cb3885f8b553b052ca3c3dfef3a508b        refs/tags/1.5.1\n73580be6e04cf2e106c70ab352a94e2bfd5faeb6        refs/tags/1.5.10\n85fe03cb12f795c2b40239d0e656de63eb7c81d7        refs/tags/1.5.11\n469a1473911289b9a60c069094113bb9ef97a0f8        refs/tags/1.5.12\n94bc2757622ccfd3668dd9b505d623893e37efbe        refs/tags/1.6.0\n5aef76575a993d51f0ae628b36964c37cd26a7c3        refs/tags/1.7.0\n0141ecaa92a34aac63fb2c0689683eb1a701dca3        refs/tags/1.7.1\nd5d7d1962bdb8d5f7444696cb4ea07d6a6ab8d9e        refs/tags/1.7.2\n2a844908229621f9c31ccb5b33d8907abeb64b36        refs/tags/1.7.4\n8c07c4666d6e9eb88f0197416a38f841cf2c9b9d        refs/tags/1.7.6\n046968a4fa5767db9387e940d5138ac10391020f        refs/tags/1.8.0\nec48db4ecacda648333596ef17ce8a0a588645a8        refs/tags/1.8.1\nad7c88741bf2631eca9c3d24721b1bd8ec4a4793        refs/tags/1.8.2\nbe0f3ccd11f5064b40f089b62152b820fb3aaf6f        refs/tags/1.8.3\na633ac7b02b513e0d8a44152448e3c43ace996d0        refs/tags/1.8.4\n71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/tags/1.8.5\nroot@asgard:/var/www/adastra/xml2pdf/current# cd /var/www/git/xml2pdf.git/\nroot@asgard:/var/www/git/xml2pdf.git# git pull\nremote: Counting objects: 8, done.\nremote: Compressing objects: 100% (6/6), done.\nremote: Total 6 (delta 4), reused 0 (delta 0)\nUnpacking objects: 100% (6/6), done.\nFrom /movies/www/adastra/xml2pdf/current/\n    d3f3d84..71ab4ee  master     -> origin/master\n  * [new tag]         1.8.5      -> 1.8.5\nUpdating d3f3d84..71ab4ee\nFast forward\n  xml2pdf.pl |   22 +++++++++++-----------\n  1 files changed, 11 insertions(+), 11 deletions(-)\nroot@asgard:/var/www/git/xml2pdf.git# cd -\n/var/www/adastra/xml2pdf/current\nroot@asgard:/var/www/adastra/xml2pdf/current# git ls-remote public\nroot@asgard's password:\n71ab4eea48eb3407a2ff4eef2befe9251897d676        HEAD\n71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/heads/localmaster\n71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/remotes/origin/master\n7fcb26098cb3885f8b553b052ca3c3dfef3a508b        refs/tags/1.5.1\n73580be6e04cf2e106c70ab352a94e2bfd5faeb6        refs/tags/1.5.10\n85fe03cb12f795c2b40239d0e656de63eb7c81d7        refs/tags/1.5.11\n469a1473911289b9a60c069094113bb9ef97a0f8        refs/tags/1.5.12\n94bc2757622ccfd3668dd9b505d623893e37efbe        refs/tags/1.6.0\n5aef76575a993d51f0ae628b36964c37cd26a7c3        refs/tags/1.7.0\n0141ecaa92a34aac63fb2c0689683eb1a701dca3        refs/tags/1.7.1\nd5d7d1962bdb8d5f7444696cb4ea07d6a6ab8d9e        refs/tags/1.7.2\n2a844908229621f9c31ccb5b33d8907abeb64b36        refs/tags/1.7.4\n8c07c4666d6e9eb88f0197416a38f841cf2c9b9d        refs/tags/1.7.6\n046968a4fa5767db9387e940d5138ac10391020f        refs/tags/1.8.0\nec48db4ecacda648333596ef17ce8a0a588645a8        refs/tags/1.8.1\nad7c88741bf2631eca9c3d24721b1bd8ec4a4793        refs/tags/1.8.2\nbe0f3ccd11f5064b40f089b62152b820fb3aaf6f        refs/tags/1.8.3\n71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/tags/1.8.5\nroot@asgard:/var/www/adastra/xml2pdf/current# git ls-remote .\n71ab4eea48eb3407a2ff4eef2befe9251897d676        HEAD\n71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/heads/master\n7fcb26098cb3885f8b553b052ca3c3dfef3a508b        refs/tags/1.5.1\n73580be6e04cf2e106c70ab352a94e2bfd5faeb6        refs/tags/1.5.10\n85fe03cb12f795c2b40239d0e656de63eb7c81d7        refs/tags/1.5.11\n469a1473911289b9a60c069094113bb9ef97a0f8        refs/tags/1.5.12\n94bc2757622ccfd3668dd9b505d623893e37efbe        refs/tags/1.6.0\n5aef76575a993d51f0ae628b36964c37cd26a7c3        refs/tags/1.7.0\n0141ecaa92a34aac63fb2c0689683eb1a701dca3        refs/tags/1.7.1\nd5d7d1962bdb8d5f7444696cb4ea07d6a6ab8d9e        refs/tags/1.7.2\n2a844908229621f9c31ccb5b33d8907abeb64b36        refs/tags/1.7.4\n8c07c4666d6e9eb88f0197416a38f841cf2c9b9d        refs/tags/1.7.6\n046968a4fa5767db9387e940d5138ac10391020f        refs/tags/1.8.0\nec48db4ecacda648333596ef17ce8a0a588645a8        refs/tags/1.8.1\nad7c88741bf2631eca9c3d24721b1bd8ec4a4793        refs/tags/1.8.2\nbe0f3ccd11f5064b40f089b62152b820fb3aaf6f        refs/tags/1.8.3\na633ac7b02b513e0d8a44152448e3c43ace996d0        refs/tags/1.8.4\n71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/tags/1.8.5\n"},{"id":"78234","messageId":"20080531155036.GA27397@sigill.intra.peff.net","threadId":"13741","inReplyTo":"alpine.DEB.1.10.0805310759540.15294@asgard.lang.hm","subject":"Re: unable to push","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-05-31T15:50:36Z","receivedAt":"2008-05-31T15:50:36Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 31, 2008 at 08:03:47AM -0700, david@lang.hm wrote:\n\n> for some reason when I try to push to my public repo I get a message that  \n> everything is up to date, but if I switch to that repo and do a pull it  \n> updates properly\n\nIf you \"git push\" without a refspec, it pushes \"matching branches\". See\ngit-push(1) for more details.\n\n> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote public\n> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        HEAD\n> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        refs/heads/localmaster\n\nSo you have only one branch, \"localmaster\".\n\n> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote .\n> 71ab4eea48eb3407a2ff4eef2befe9251897d676        HEAD\n> 71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/heads/master\n\nBut the remote has only one branch, \"master\".\n\nIf you want to push your localmaster to his master, you can do:\n\n  git push origin localmaster:master\n\nYou can also set it up permanently by adding a \"remote.origin.push\" line\nto your config file.\n\nBut I do wonder why you don't just name your local branch \"master\" in\nthe first place (it won't conflict in your local repo with the remote's\nmaster, which can be named as \"origin/master\").\n\n> root@asgard:/var/www/git/xml2pdf.git# git pull\n> remote: Counting objects: 8, done.\n> remote: Compressing objects: 100% (6/6), done.\n> remote: Total 6 (delta 4), reused 0 (delta 0)\n> Unpacking objects: 100% (6/6), done.\n> From /movies/www/adastra/xml2pdf/current/\n>    d3f3d84..71ab4ee  master     -> origin/master\n>  * [new tag]         1.8.5      -> 1.8.5\n> Updating d3f3d84..71ab4ee\n> Fast forward\n>  xml2pdf.pl |   22 +++++++++++-----------\n>  1 files changed, 11 insertions(+), 11 deletions(-)\n\nAnd this pulls from master -> localmaster, presumably because you have a\nbranch.localmaster.merge config option (which is generally set up by\ndefault these days).\n\n-Peff\n"},{"id":"78235","messageId":"alpine.DEB.1.10.0805310855000.15294@asgard.lang.hm","threadId":"13741","inReplyTo":"20080531155036.GA27397@sigill.intra.peff.net","subject":"Re: unable to push","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-05-31T16:10:26Z","receivedAt":"2008-05-31T16:10:26Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Sat, 31 May 2008, Jeff King wrote:\n\n> On Sat, May 31, 2008 at 08:03:47AM -0700, david@lang.hm wrote:\n>\n>> for some reason when I try to push to my public repo I get a message that\n>> everything is up to date, but if I switch to that repo and do a pull it\n>> updates properly\n>\n> If you \"git push\" without a refspec, it pushes \"matching branches\". See\n> git-push(1) for more details.\n>\n>> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote public\n>> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        HEAD\n>> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        refs/heads/localmaster\n>\n> So you have only one branch, \"localmaster\".\n>\n>> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote .\n>> 71ab4eea48eb3407a2ff4eef2befe9251897d676        HEAD\n>> 71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/heads/master\n>\n> But the remote has only one branch, \"master\".\n>\n> If you want to push your localmaster to his master, you can do:\n>\n>  git push origin localmaster:master\n>\n> You can also set it up permanently by adding a \"remote.origin.push\" line\n> to your config file.\n>\n> But I do wonder why you don't just name your local branch \"master\" in\n> the first place (it won't conflict in your local repo with the remote's\n> master, which can be named as \"origin/master\").\n\nI created localmaster in an attempt to get things working again. I'll try \ncreating a new master branch... that does make it work again, thanks.\n\nwhat I'm not understanding completely is how I broke things in the first \nplace.\n\ngoing back through .git/logs/HEAD it looks like I did a checkout HEAD^^^ \nand never properly recovered. should I have done a checkout master to get \nthings back on track? I had thought that I could do a checkout of an old \nversion, modify it, do a commit, and the commit would go on top of the old \nHEAD and I could just keep going (the reason for doing this instead of a \nreset is that I had already published the intermediate commits to the \npublic repo, so I didn't want to roll back the history, just get the old \nversion of one of the files)\n\n>> root@asgard:/var/www/git/xml2pdf.git# git pull\n>> remote: Counting objects: 8, done.\n>> remote: Compressing objects: 100% (6/6), done.\n>> remote: Total 6 (delta 4), reused 0 (delta 0)\n>> Unpacking objects: 100% (6/6), done.\n>> From /movies/www/adastra/xml2pdf/current/\n>>    d3f3d84..71ab4ee  master     -> origin/master\n>>  * [new tag]         1.8.5      -> 1.8.5\n>> Updating d3f3d84..71ab4ee\n>> Fast forward\n>>  xml2pdf.pl |   22 +++++++++++-----------\n>>  1 files changed, 11 insertions(+), 11 deletions(-)\n>\n> And this pulls from master -> localmaster, presumably because you have a\n> branch.localmaster.merge config option (which is generally set up by\n> default these days).\n\nI manually setup the localmaster when I was having trouble getting things \nto work in either direction.\n\nDavid Lang\n"},{"id":"78236","messageId":"48418242.1050606@users.sourceforge.net","threadId":"13741","inReplyTo":"20080531155036.GA27397@sigill.intra.peff.net","subject":"Re: unable to push","fromName":"Adam Piątyszek","fromEmail":"ediap@users.sourceforge.net","sentAt":"2008-05-31T16:52:18Z","receivedAt":"2008-05-31T16:52:18Z","isPatch":false,"sender":{"key":"ediap@users.sourceforge.net","avatar":null},"body":"* Jeff King [31 V 2008 17:50]:\n> On Sat, May 31, 2008 at 08:03:47AM -0700, david@lang.hm wrote:\n> \n>> for some reason when I try to push to my public repo I get a message that  \n>> everything is up to date, but if I switch to that repo and do a pull it  \n>> updates properly\n> \n> If you \"git push\" without a refspec, it pushes \"matching branches\". See\n> git-push(1) for more details.\n> \n>> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote public\n>> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        HEAD\n>> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        refs/heads/localmaster\n> \n> So you have only one branch, \"localmaster\".\n> \n>> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote .\n>> 71ab4eea48eb3407a2ff4eef2befe9251897d676        HEAD\n>> 71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/heads/master\n> \n> But the remote has only one branch, \"master\".\n> \n> If you want to push your localmaster to his master, you can do:\n> \n>   git push origin localmaster:master\n[...]\n\nI guess Peef described it the opposite way. In my opinion \"localmaster\" \nis the only branch on the remote \"public\" repository and the local \nrepository has only one \"master\" branch.\n\nSo to push local \"master\" to the remote \"localmaster\" branch you should use:\n\n   git push public master:localmaster\n\nBR,\n/Adam\n\n\n-- \n.:.  Adam Piątyszek (ediap)  .:.....................................:.\n.:.  ediap@users.sourceforge.net  .:................................:.\n"},{"id":"78297","messageId":"20080601182205.GA742@sigill.intra.peff.net","threadId":"13741","inReplyTo":"alpine.DEB.1.10.0805310855000.15294@asgard.lang.hm","subject":"Re: unable to push","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-01T18:22:05Z","receivedAt":"2008-06-01T18:22:05Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 31, 2008 at 09:10:26AM -0700, david@lang.hm wrote:\n\n> I created localmaster in an attempt to get things working again. I'll try  \n> creating a new master branch... that does make it work again, thanks.\n>\n> what I'm not understanding completely is how I broke things in the first  \n> place.\n\nI'm not understanding that, either. You not only created localmaster,\nbut you deleted master. Did you maybe do a \"git branch -m\"?\n\n> going back through .git/logs/HEAD it looks like I did a checkout HEAD^^^  \n> and never properly recovered. should I have done a checkout master to get  \n> things back on track? I had thought that I could do a checkout of an old  \n> version, modify it, do a commit, and the commit would go on top of the old \n> HEAD and I could just keep going (the reason for doing this instead of a  \n> reset is that I had already published the intermediate commits to the  \n> public repo, so I didn't want to roll back the history, just get the old  \n> version of one of the files)\n\nI think you did eventually \"recover\" which is to say you ended up on the\nlocalmaster branch. When you did a checkout of HEAD^^^, your HEAD became\n\"detached\", meaning that you were no longer on any branch, but at a\nspecific commit (and there should have been a warning message mentioning\nthat).\n\nWhen you make commits on a detached HEAD, your HEAD remains detached,\nmeaning that those commits are not on any branch. So when you did a\ncheckout back to some actual branch, those commits were \"lost\" (meaning\nthat no branch contains them, but they are still available by peeking\nthrough the reflog).\n\nBut that shouldn't have had anything to do with the state of the master\nbranch; once you detached, you were purely operating on the detached\nHEAD.\n\n-Peff\n"},{"id":"78298","messageId":"20080601182417.GB742@sigill.intra.peff.net","threadId":"13741","inReplyTo":"48418242.1050606@users.sourceforge.net","subject":"Re: unable to push","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-01T18:24:17Z","receivedAt":"2008-06-01T18:24:17Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 31, 2008 at 06:52:18PM +0200, Adam Piątyszek wrote:\n\n>>> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote public\n>>> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        HEAD\n>>> d3f3d8474db1c006a53be8b5f5c1a0d866d7e357        refs/heads/localmaster\n>>\n>> So you have only one branch, \"localmaster\".\n>>\n>>> root@asgard:/var/www/adastra/xml2pdf/current# git ls-remote .\n>>> 71ab4eea48eb3407a2ff4eef2befe9251897d676        HEAD\n>>> 71ab4eea48eb3407a2ff4eef2befe9251897d676        refs/heads/master\n>>\n>> But the remote has only one branch, \"master\".\n>>\n>> If you want to push your localmaster to his master, you can do:\n>>\n>>   git push origin localmaster:master\n> [...]\n>\n> I guess Peef described it the opposite way. In my opinion \"localmaster\"  \n> is the only branch on the remote \"public\" repository and the local  \n> repository has only one \"master\" branch.\n\nOh, sorry, I did totally read that backwards. So yes, there is a local\n\"master\" branch but not a remote master branch (instead it has\n\"localmaster\"). So the problem is the same (push without a refspec\npushes matching refs, and you don't have any matches) but the fix is, as\nAdam pointed out:\n\n> So to push local \"master\" to the remote \"localmaster\" branch you should use:\n>\n>   git push public master:localmaster\n\nSorry for the confusion.\n\n-Peff\n"},{"id":"78299","messageId":"20080601182530.GA783@sigill.intra.peff.net","threadId":"13741","inReplyTo":"20080601182205.GA742@sigill.intra.peff.net","subject":"Re: unable to push","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-01T18:25:30Z","receivedAt":"2008-06-01T18:25:30Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jun 01, 2008 at 02:22:05PM -0400, Jeff King wrote:\n\n> I'm not understanding that, either. You not only created localmaster,\n> but you deleted master. Did you maybe do a \"git branch -m\"?\n\nHaving just read Adam's message, I see that I read your \"ls-remote\"s\nbackwards.\n\nSo it's not that you created localmaster and deleted master, but rather\nthat somehow the master on your \"public\" repo got deleted (or never\nexisted in the first place?).\n\n-Peff\n"},{"id":"78300","messageId":"alpine.DEB.1.10.0806011125340.15294@asgard.lang.hm","threadId":"13741","inReplyTo":"20080601182205.GA742@sigill.intra.peff.net","subject":"Re: unable to push","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-06-01T18:28:39Z","receivedAt":"2008-06-01T18:28:39Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Sun, 1 Jun 2008, Jeff King wrote:\n\n> On Sat, May 31, 2008 at 09:10:26AM -0700, david@lang.hm wrote:\n>\n>> I created localmaster in an attempt to get things working again. I'll try\n>> creating a new master branch... that does make it work again, thanks.\n>>\n>> what I'm not understanding completely is how I broke things in the first\n>> place.\n>\n> I'm not understanding that, either. You not only created localmaster,\n> but you deleted master. Did you maybe do a \"git branch -m\"?\n\nin the public repo I had never created a 'master' branch. I had just done \na clone, setup git daemon, and pushed to it.\n\nat some point several days later I found that my push didn't work and that \nI wasn't on any branch in the public repo. in reading the man page for git \nbranch I saw the --track option, so I created the localmaster branch to \ntry and get things working.\n\n>> going back through .git/logs/HEAD it looks like I did a checkout HEAD^^^\n>> and never properly recovered. should I have done a checkout master to get\n>> things back on track? I had thought that I could do a checkout of an old\n>> version, modify it, do a commit, and the commit would go on top of the old\n>> HEAD and I could just keep going (the reason for doing this instead of a\n>> reset is that I had already published the intermediate commits to the\n>> public repo, so I didn't want to roll back the history, just get the old\n>> version of one of the files)\n>\n> I think you did eventually \"recover\" which is to say you ended up on the\n> localmaster branch. When you did a checkout of HEAD^^^, your HEAD became\n> \"detached\", meaning that you were no longer on any branch, but at a\n> specific commit (and there should have been a warning message mentioning\n> that).\n>\n> When you make commits on a detached HEAD, your HEAD remains detached,\n> meaning that those commits are not on any branch. So when you did a\n> checkout back to some actual branch, those commits were \"lost\" (meaning\n> that no branch contains them, but they are still available by peeking\n> through the reflog).\n>\n> But that shouldn't have had anything to do with the state of the master\n> branch; once you detached, you were purely operating on the detached\n> HEAD.\n\nthat explains things.\n\nDavid Lang\n"},{"id":"78301","messageId":"20080601183134.GA2623@sigill.intra.peff.net","threadId":"13741","inReplyTo":"alpine.DEB.1.10.0806011125340.15294@asgard.lang.hm","subject":"Re: unable to push","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-01T18:31:34Z","receivedAt":"2008-06-01T18:31:34Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jun 01, 2008 at 11:28:39AM -0700, david@lang.hm wrote:\n\n>> I'm not understanding that, either. You not only created localmaster,\n>> but you deleted master. Did you maybe do a \"git branch -m\"?\n>\n> in the public repo I had never created a 'master' branch. I had just done  \n> a clone, setup git daemon, and pushed to it.\n\nDid you mean \"init\" here instead of clone? The clone should have created\nat least one branch (generally master, but depending on the current\nbranch of the cloned repo).\n\n> at some point several days later I found that my push didn't work and that \n> I wasn't on any branch in the public repo. in reading the man page for git \n> branch I saw the --track option, so I created the localmaster branch to  \n> try and get things working.\n\nAh, ok. That makes sense. The right fix was to just manually specify the\nrefspec the first time (\"git push public master\") after which you could\njust do \"git push public\" if you wanted.\n\n-Peff\n"},{"id":"78302","messageId":"alpine.DEB.1.10.0806011133050.15294@asgard.lang.hm","threadId":"13741","inReplyTo":"20080601183134.GA2623@sigill.intra.peff.net","subject":"Re: unable to push","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-06-01T18:34:19Z","receivedAt":"2008-06-01T18:34:19Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Sun, 1 Jun 2008, Jeff King wrote:\n\n> On Sun, Jun 01, 2008 at 11:28:39AM -0700, david@lang.hm wrote:\n>\n>>> I'm not understanding that, either. You not only created localmaster,\n>>> but you deleted master. Did you maybe do a \"git branch -m\"?\n>>\n>> in the public repo I had never created a 'master' branch. I had just done\n>> a clone, setup git daemon, and pushed to it.\n>\n> Did you mean \"init\" here instead of clone? The clone should have created\n> at least one branch (generally master, but depending on the current\n> branch of the cloned repo).\n\nno, it was definantly a clone, and it did not create a master branch (at \nleast not one that showed up with git branch -a)\n\nDavid Lang\n\n>> at some point several days later I found that my push didn't work and that\n>> I wasn't on any branch in the public repo. in reading the man page for git\n>> branch I saw the --track option, so I created the localmaster branch to\n>> try and get things working.\n>\n> Ah, ok. That makes sense. The right fix was to just manually specify the\n> refspec the first time (\"git push public master\") after which you could\n> just do \"git push public\" if you wanted.\n>\n> -Peff\n>\n"},{"id":"78303","messageId":"20080601183659.GA5818@sigill.intra.peff.net","threadId":"13741","inReplyTo":"alpine.DEB.1.10.0806011133050.15294@asgard.lang.hm","subject":"Re: unable to push","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-01T18:36:59Z","receivedAt":"2008-06-01T18:36:59Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jun 01, 2008 at 11:34:19AM -0700, david@lang.hm wrote:\n\n>> Did you mean \"init\" here instead of clone? The clone should have created\n>> at least one branch (generally master, but depending on the current\n>> branch of the cloned repo).\n>\n> no, it was definantly a clone, and it did not create a master branch (at  \n> least not one that showed up with git branch -a)\n\nHmm. It's possible that you cloned a repo that didn't have its HEAD\npointing at the master branch (for example, one with a detached HEAD).\nAnd that would explain how you got into that situation (and either way,\nthe discussed ways out of the situation apply).\n\n-Peff\n"}]}