{"thread":{"id":"54573","subject":"BUG","startedAt":"2020-11-04T16:10:21Z","lastAt":"2020-11-04T17:54:58Z","messageCount":3,"participants":["Alex Marginean","Randall S. Becker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"409093","messageId":"CALG6MqwdCmwS5D_F9+q6UYzGm5ZzLL7Bi=rD7Ph2XE0uccu+xg@mail.gmail.com","threadId":"54573","inReplyTo":null,"subject":"BUG","fromName":"Alex Marginean","fromEmail":"alexmarginean16@gmail.com","sentAt":"2020-11-04T16:10:06Z","receivedAt":"2020-11-04T16:10:21Z","isPatch":false,"sender":{"key":"alexmarginean16@gmail.com","avatar":null},"body":"Hey,\n\nGithub has changed the way they name branches, so now instead of the\n`master` branch there is the `main` branch however, I'm having some\ntrouble with the naming\n\n**Steps to replicate my problem**\n\n1. Create a new Github repository and make sure the default branch is `main`\n2. Add something to the repo, a `README.md` file should be enough\n3. Instead of cloning the repo make a new directory with your repo's\nname `mkdir <repo_name>` and change the directory to it `cd\n<repo_name>`\n4. `git init`\n5. Add the remote repo with `git remote add origin <repo_link>`\n6. Pull the `main` branch from the remote repo with `git pull origin main`.\n\nAfter the step number 6. instead of my branch changing to `main` my\ncurrent branch is changed to `master` which has every file and change\nof the branch `main`. This is a real problem because if I try to push\nchanges to `main` although my current branch shows up as `master` it\ncreates another branch called `master` on Github and the `main`\nremains unchanged. Yeah sure I can `git checkout main` after that and\nmake my changes there but I'm not sure why it defaults to `master` and\ncopies `main` from Github into local branch `master`.\n\nP.S. If you were to use `git fetch origin` instead of `git pull origin\n<branch_name> and then manually change branch to `main` with `git\ncheckout main` it would work. Also, if you were to clone the Github\nrepo using `git clone <link>` you will get the correct current branch\nthat is `main`.\n\nSincerely,\nAlex\n\n\nThank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\nGithub has changed the way they name branches, so now instead of the `master` branch there is the `main` branch however, I'm having some trouble with the naming\n\n1. Create a new Github repository and make sure the default branch is `main`\n2. Add something to the repo, a `README.md` file should be enough\n3. Instead of cloning the repo make a new directory with your repo's name `mkdir <repo_name>` and change the directory to it `cd <repo_name>`\n4. `git init`\n5. Add the remote repo with `git remote add origin <repo_link>`\n6. Pull the `main` branch from the remote repo with `git pull origin main`.\n\nWhat did you expect to happen? (Expected behavior)\n\nAfter step 6. I expected to be switched to a branch called `main` that would include every file and change from the `main` branch on the origin. \n\nWhat happened instead? (Actual behavior)\n\nAfter the step number 6. instead of my branch changing to `main` my current branch is changed to `master` which has every file and change of the branch `main`. This is a real problem because if I try to push changes to `main` although my current branch shows up as `master` it creates another branch called `master` on Github and the `main` remains unchanged. Yeah sure I can `git checkout main` after that and make my changes there but I'm not sure why it defaults to `master` and copies `main` from Github into local branch `master`.\n\nWhat's different between what you expected and what actually happened?\n\nThe name of the branch and the duplication of the `main` branch to a branch called `master`.\n\nAnything else you want to add:\n\nP.S. If you were to use `git fetch origin` instead of `git pull origin <branch_name> and then manually change branch to `main` with `git checkout main` it would work. Also, if you were to clone the Github repo using `git clone <link>` you will get the correct current branch that is `main`.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.29.2\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64\ncompiler info: clang: 12.0.0 (clang-1200.0.32.21)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"},{"id":"409100","messageId":"037901d6b2cc$5362e170$fa28a450$@nexbridge.com","threadId":"54573","inReplyTo":"CALG6MqwdCmwS5D_F9+q6UYzGm5ZzLL7Bi=rD7Ph2XE0uccu+xg@mail.gmail.com","subject":"RE: BUG","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2020-11-04T17:02:43Z","receivedAt":"2020-11-04T17:02:55Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On November 4, 2020 11:10 AM, Alex Marginean wrote:\n> Github has changed the way they name branches, so now instead of the\n> `master` branch there is the `main` branch however, I'm having some trouble\n> with the naming\n> \n> **Steps to replicate my problem**\n> \n> 1. Create a new Github repository and make sure the default branch is `main`\n> 2. Add something to the repo, a `README.md` file should be enough 3.\n> Instead of cloning the repo make a new directory with your repo's name\n> `mkdir <repo_name>` and change the directory to it `cd <repo_name>` 4. `git\n> init` 5. Add the remote repo with `git remote add origin <repo_link>` 6. Pull\n> the `main` branch from the remote repo with `git pull origin main`.\n\nUse git init --initial-branch=main\n\nThis assumes a recent version of git.\n\n> \n> After the step number 6. instead of my branch changing to `main` my current\n> branch is changed to `master` which has every file and change of the branch\n> `main`. This is a real problem because if I try to push changes to `main`\n> although my current branch shows up as `master` it creates another branch\n> called `master` on Github and the `main` remains unchanged. Yeah sure I can\n> `git checkout main` after that and make my changes there but I'm not sure\n> why it defaults to `master` and copies `main` from Github into local branch\n> `master`.\n> \n> P.S. If you were to use `git fetch origin` instead of `git pull origin\n> <branch_name> and then manually change branch to `main` with `git\n> checkout main` it would work. Also, if you were to clone the Github repo\n> using `git clone <link>` you will get the correct current branch that is `main`.\n\nRegards,\nRandall\n-- Brief whoami:\n NonStop developer since approximately 211288444200000000\n UNIX developer since approximately 421664400\n-- In my real life, I talk too much.\n\n"},{"id":"409117","messageId":"037e01d6b2d3$9957f3d0$cc07db70$@nexbridge.com","threadId":"54573","inReplyTo":"CALG6MqwdCmwS5D_F9+q6UYzGm5ZzLL7Bi=rD7Ph2XE0uccu+xg@mail.gmail.com","subject":"RE: BUG","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2020-11-04T17:54:47Z","receivedAt":"2020-11-04T17:54:58Z","isPatch":false,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On November 4, 2020 12:03 PM, I wrote:\n> To: 'Alex Marginean' <alexmarginean16@gmail.com>; 'git@vger.kernel.org'\n> <git@vger.kernel.org>\n> Subject: RE: BUG\n> \n> On November 4, 2020 11:10 AM, Alex Marginean wrote:\n> > Github has changed the way they name branches, so now instead of the\n> > `master` branch there is the `main` branch however, I'm having some\n> > trouble with the naming\n> >\n> > **Steps to replicate my problem**\n> >\n> > 1. Create a new Github repository and make sure the default branch is\n> > `main` 2. Add something to the repo, a `README.md` file should be enough\n> 3.\n> > Instead of cloning the repo make a new directory with your repo's name\n> > `mkdir <repo_name>` and change the directory to it `cd <repo_name>` 4.\n> > `git init` 5. Add the remote repo with `git remote add origin\n> > <repo_link>` 6. Pull the `main` branch from the remote repo with `git pull\n> origin main`.\n> \n> Use git init --initial-branch=main\n\nYou could also use git branch -m master main after the git init if your version of git is too old.\n\n> \n> This assumes a recent version of git.\n> \n> >\n> > After the step number 6. instead of my branch changing to `main` my\n> > current branch is changed to `master` which has every file and change\n> > of the branch `main`. This is a real problem because if I try to push\n> > changes to `main` although my current branch shows up as `master` it\n> > creates another branch called `master` on Github and the `main`\n> > remains unchanged. Yeah sure I can `git checkout main` after that and\n> > make my changes there but I'm not sure why it defaults to `master` and\n> > copies `main` from Github into local branch `master`.\n> >\n> > P.S. If you were to use `git fetch origin` instead of `git pull origin\n> > <branch_name> and then manually change branch to `main` with `git\n> > checkout main` it would work. Also, if you were to clone the Github\n> > repo using `git clone <link>` you will get the correct current branch that is\n> `main`.\n> \n> Regards,\n> Randall\n> -- Brief whoami:\n>  NonStop developer since approximately 211288444200000000  UNIX\n> developer since approximately 421664400\n> -- In my real life, I talk too much.\n\n"}]}