user1403546
user1403546

Reputation: 1749

git - confusion with branch heads?

I created a branch bbb_dev from a branch bbb. After having commited and pushed by doing

git push origin bbb_dev

I still get, when typing 'git status' the message

On branch bbb_dev
Your branch is ahead of 'origin/bbb' by 3 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

So it looks that the branch bbb_dev is still somehow connected to the branch bbb. I'd like to push commits to bbb_dev by simply doing 'git push'... Is there any risk that changes done to bbb_dev will be done also to bbb? Do I maybe need to set differently the head of bbb_dev?

Upvotes: 0

Views: 78

Answers (1)

LeGEC
LeGEC

Reputation: 51780

To link your local branch to a remote bbb_dev branch :

# from branch bbb_dev
git branch -u bbb_dev

If remote branch bbb_dev does not exist : push it and set upstream in one go :

git push origin -u bbb_dev:bbb_dev

Upvotes: 2

Related Questions