Ganbayar Gansukh
Ganbayar Gansukh

Reputation: 766

Push local new Git repo to existing remote repo as branch?

I have a situation where I completely re-wrote the code from scratch where we had current existing code on the remote repo.

I would like to push my local new repo master to that existing remote as a branch to merge it later upon review.

Remote git repo: A has branches a1, a2, a3

My local new repo: B

After my desired push to remote: A has branches a1, a2, a3, and ab

Is it even possible?

Thank you.

Upvotes: 5

Views: 1225

Answers (1)

larsks
larsks

Reputation: 311308

Sure. Just push it like this:

git push origin master:ab

This will push your local master branch to ab branch of the remote named origin.

Upvotes: 4

Related Questions