{"thread":{"id":"40266","subject":"Bug Report: git gui clones non-master default branch as master","startedAt":"2015-09-03T17:01:16Z","lastAt":"2015-09-18T19:10:24Z","messageCount":2,"participants":["John Medema"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"269342","messageId":"CALsXy+1p7ekshWNAvA991nWRcUUFv1zW39G2Wm=U0vvQ2O6PuA@mail.gmail.com","threadId":"40266","inReplyTo":null,"subject":"Bug Report: git gui clones non-master default branch as master","fromName":"John Medema","fromEmail":"john.medema@uniteddrugs.com","sentAt":"2015-09-03T17:01:16Z","receivedAt":"2015-09-03T17:01:16Z","isPatch":false,"sender":{"key":"john.medema@uniteddrugs.com","avatar":null},"body":"Git gurus, your assistance is needed.\n\nEnvironment #1:\ngit version 2.5.0.windows.1\ngit-gui version 0.20.GITGUI\nWindows 7 Pro 64-bit\n\nEnvironment #2:\ngit version 1.7.9.msysgit.0\ngit-gui version 0.16.GITGUI\nWindows Server 2003 R2 32-bit\n\nEnvironment #3:\nLinux (check with dscho, https://github.com/git-for-windows/git/issues/345)\n\nIssue:\nCloning from Git GUI when the upstream repo has the default branch set\nto something other than master (say \"develop\") yields a local\nrepository with a single branch named \"master\". This local master\nbranch has no pull link, but it has a push link pointing to the\norigin/master, leading to a situation where a commit meant for\norigin/develop is instead pushed to origin/master. Note that this only\nhappens when cloning from the Git GUI - using Git Bash creates a local\ndevelop branch pulling & pushing to origin/develop.\n\nTo reproduce (example uses fake repo):\n1) Open Git GUI\n2) Click \"Clone Existing Repository\"\nSource Location: git@github.com:PrivateCo/mytestrepo.git\nTarget Directory: c:\\temp\\mytestrepo\nClone\n3) Open Git Bash\n4) $ cd /c/temp/mytestrepo\n5) $ git remote show origin\nremote origin Fetch URL: git@github.com:PrivateCo/mytestrepo.git\nPush URL: git@github.com:PrivateCo/mytestrepo.git\nHEAD branch: develop\nRemote branches:\ndevelop tracked\nmaster tracked\nLocal ref configured for 'git push':\nmaster pushes to master (fast-forwardable)\n6) $ git branch -avv\nmaster 846504a 2nd test file, just for develop branch\nremotes/origin/develop 846504a 2nd test file, just for develop branch\nremotes/origin/master c2b577c initial commit with test file\n\nWorkaround (creates new develop branch, wipes out bad master, and\nrecreates master):\n1) Open Git Bash\n2) $ cd /c/temp/mytestrepo\n3) $ git checkout -b develop --track origin/develop\n4) $ git branch -d master\n5) $ git checkout -b master --track origin/master\n6) $ git remote show origin\nremote origin Fetch URL: git@github.com:PrivateCo/mytestrepo.git\nPush URL: git@github.com:PrivateCo/mytestrepo.git\nHEAD branch: develop\nRemote branches:\ndevelop tracked\nmaster tracked\nLocal branches configured for 'git pull':\ndevelop merges with remote develop\nmaster merges with remote master\nLocal refs configured for 'git push': develop pushes to develop (up to date)\nmaster pushes to master (up to date)\n7) $ git branch -avv\ndevelop 846504a [origin/develop] 2nd test file, just for develop branch\nmaster c2b577c [origin/master] initial commit with test file\nremotes/origin/develop 846504a 2nd test file, just for develop branch\nremotes/origin/master c2b577c initial commit with test file\n\n\nLet me know if you need any more information.\n\nJohn Medema\nSystems Administrator\nUnited Drugs, a Subsidiary of AAP (American Associated Pharmacies)\njohn.medema@uniteddrugs.com\n7243 N 16th Street, Phoenix, AZ 85020\nOffice:  602-678-1179 x126\nFax:  602-639-4631\n\n-- \nHIPAA NOTICE:  It is against United Drugs’ policy to receive or send \nun-encrypted or non-secured email correspondence containing Protected \nHealth Information (PHI) as defined by HIPAA law.\n \nPlease use fax or phone for correspondence containing PHI.\n\n-- \nThis email message is for the sole use of the intended recipient(s) and may \ncontain confidential and privileged information. Any unauthorized review, \nuse, disclosure or distribution is prohibited. If you are not the intended \nrecipient, contact the sender by reply email, and destroy all copies of the \noriginal message. \n"},{"id":"270313","messageId":"CALsXy+3gpXJx2=44N_eqcLjc7fYNbPVMKa1rERygzDoVu05iTg@mail.gmail.com","threadId":"40266","inReplyTo":"CALsXy+1p7ekshWNAvA991nWRcUUFv1zW39G2Wm=U0vvQ2O6PuA@mail.gmail.com","subject":"Re: Bug Report: git gui clones non-master default branch as master","fromName":"John Medema","fromEmail":"john.medema@uniteddrugs.com","sentAt":"2015-09-18T19:10:24Z","receivedAt":"2015-09-18T19:10:24Z","isPatch":false,"sender":{"key":"john.medema@uniteddrugs.com","avatar":null},"body":"Git devs,\n\nCan I get a confirmation that someone has confirmed this as a bug?\nAnd that it is in a queue somewhere for eventual fixing?\n\nThanks,\n\nJohn Medema\nSystems Administrator\nUnited Drugs, a Subsidiary of AAP (American Associated Pharmacies)\njohn.medema@uniteddrugs.com\n7243 N 16th Street, Phoenix, AZ 85020\nOffice:  602-678-1179 x126\nFax:  602-639-4631\n\n\nOn Thu, Sep 3, 2015 at 10:01 AM, John Medema\n<john.medema@uniteddrugs.com> wrote:\n> Git gurus, your assistance is needed.\n>\n> Environment #1:\n> git version 2.5.0.windows.1\n> git-gui version 0.20.GITGUI\n> Windows 7 Pro 64-bit\n>\n> Environment #2:\n> git version 1.7.9.msysgit.0\n> git-gui version 0.16.GITGUI\n> Windows Server 2003 R2 32-bit\n>\n> Environment #3:\n> Linux (check with dscho, https://github.com/git-for-windows/git/issues/345)\n>\n> Issue:\n> Cloning from Git GUI when the upstream repo has the default branch set\n> to something other than master (say \"develop\") yields a local\n> repository with a single branch named \"master\". This local master\n> branch has no pull link, but it has a push link pointing to the\n> origin/master, leading to a situation where a commit meant for\n> origin/develop is instead pushed to origin/master. Note that this only\n> happens when cloning from the Git GUI - using Git Bash creates a local\n> develop branch pulling & pushing to origin/develop.\n>\n> To reproduce (example uses fake repo):\n> 1) Open Git GUI\n> 2) Click \"Clone Existing Repository\"\n> Source Location: git@github.com:PrivateCo/mytestrepo.git\n> Target Directory: c:\\temp\\mytestrepo\n> Clone\n> 3) Open Git Bash\n> 4) $ cd /c/temp/mytestrepo\n> 5) $ git remote show origin\n> remote origin Fetch URL: git@github.com:PrivateCo/mytestrepo.git\n> Push URL: git@github.com:PrivateCo/mytestrepo.git\n> HEAD branch: develop\n> Remote branches:\n> develop tracked\n> master tracked\n> Local ref configured for 'git push':\n> master pushes to master (fast-forwardable)\n> 6) $ git branch -avv\n> master 846504a 2nd test file, just for develop branch\n> remotes/origin/develop 846504a 2nd test file, just for develop branch\n> remotes/origin/master c2b577c initial commit with test file\n>\n> Workaround (creates new develop branch, wipes out bad master, and\n> recreates master):\n> 1) Open Git Bash\n> 2) $ cd /c/temp/mytestrepo\n> 3) $ git checkout -b develop --track origin/develop\n> 4) $ git branch -d master\n> 5) $ git checkout -b master --track origin/master\n> 6) $ git remote show origin\n> remote origin Fetch URL: git@github.com:PrivateCo/mytestrepo.git\n> Push URL: git@github.com:PrivateCo/mytestrepo.git\n> HEAD branch: develop\n> Remote branches:\n> develop tracked\n> master tracked\n> Local branches configured for 'git pull':\n> develop merges with remote develop\n> master merges with remote master\n> Local refs configured for 'git push': develop pushes to develop (up to date)\n> master pushes to master (up to date)\n> 7) $ git branch -avv\n> develop 846504a [origin/develop] 2nd test file, just for develop branch\n> master c2b577c [origin/master] initial commit with test file\n> remotes/origin/develop 846504a 2nd test file, just for develop branch\n> remotes/origin/master c2b577c initial commit with test file\n>\n>\n> Let me know if you need any more information.\n>\n> John Medema\n> Systems Administrator\n> United Drugs, a Subsidiary of AAP (American Associated Pharmacies)\n> john.medema@uniteddrugs.com\n> 7243 N 16th Street, Phoenix, AZ 85020\n> Office:  602-678-1179 x126\n> Fax:  602-639-4631\n\n-- \nHIPAA NOTICE:  It is against United Drugs’ policy to receive or send \nun-encrypted or non-secured email correspondence containing Protected \nHealth Information (PHI) as defined by HIPAA law.\n \nPlease use fax or phone for correspondence containing PHI.\n\n-- \nThis email message is for the sole use of the intended recipient(s) and may \ncontain confidential and privileged information. Any unauthorized review, \nuse, disclosure or distribution is prohibited. If you are not the intended \nrecipient, contact the sender by reply email, and destroy all copies of the \noriginal message. \n"}]}