0

I have a project that needs to diverge into 3 different branches. Those branches will never be merged anymore (though certain fixes might have to be applied to all 3 branches). In the image below "master" is one of the branches. "Branch1" and "Branch2" were supposed to be separate branches showing a tree ("Graph" on the left column indicates there is no tree). From googling I understand green means local branch only. So how can I push this local branch to the remote and then check out that branch for making modifications (and pushing modifications to that branch).

Edit:

After "git push origin master" I now see origin/master. My next steps were: git branch branch3. Now I had at the bottom green(branch3)/red(master)/beige(origin/master), above branch1 green/beige and above branch2 green/beige.

git checkout branch3 Now the red box was on branch3 and master became green

I made a change to the project and then git add [changedFile] git commit -m "..." git push --set-upstream origin branch3

Now I had what I really was looking for which is:

enter image description here

Hu F.
  • 33
  • 1
  • 6
  • Can you please provide some more details? What program is the screenshot from? What OS do you use? What are you using for your git hosting? – Kristy Hughes May 21 '18 at 05:14

1 Answers1

0

Your Branch1 and Branch2 already have their remotes (origin/). Only your master doesn't (which is confusing). Anyway, you can push any local branch to remote (origin in your case) with this command: git push origin master

Optionally, you can add -u to tell git to track this branch: git push -u origin master

You can also use git in a terminal to see your repo graph: git log --oneline --decorate --graph

amaslenn
  • 797
  • 9
  • 16
  • amaslenn, thanks for the response. I updated my question based on your response. I tried to upvote you but they don't let me because I am still rather new here. I still appreciate your help. – Hu F. May 22 '18 at 06:29
  • @HuF. you are welcome! (you should still be able to mark it as the answer if it is really what you were looking for) – amaslenn May 22 '18 at 11:23