1

I'm confused in some git operations, this is my scenario:

  1. I'm working on a local branch called: "sect11_connect_dbs"

  2. in my github remote repo this branch does not exist

  3. the output of git status is this: git status output

  4. my question is: what commands do I have to use to unlink sect11 branch from sect9 and then replicate it to my remote?

Thanks a lot for your comments

htamayo
  • 335
  • 3
  • 16
  • 1
    Push with a new tracking branch? https://stackoverflow.com/questions/2765421/how-do-i-push-a-new-local-branch-to-a-remote-git-repository-and-track-it-too/6232535#6232535 – evolutionxbox Aug 21 '21 at 23:20

1 Answers1

0

Simply:

 git push -u origin sect11_connect_dbs

That override directly the unlink part of the local branch:

git config --unset branch.sect11_connect_dbs.remote
git config --unset branch.sect11_connect_dbs.merge

Which can be done also with

git branch --unset-upstream sect11_connect_dbs

(as noted by torek in the comments)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Or: `git branch --unset-upstream sect11_connect_dbs`, which does the two `git config`s for you. However, as evolutionxbox noted, the `git push -u` alone will do the job (I think you meant that in your answer too, it's not not clear that the first steps are unnecessary). – torek Aug 22 '21 at 03:15