sandeeps
sandeeps

Reputation: 1026

git push to existing remote branch

How do I push changes from a local git branch to an existing non-master remote branch? If I do a "git push", it tries to push changes in all local branches to the remotes they are tracking.

Upvotes: 42

Views: 71996

Answers (2)

Kevin Bedell
Kevin Bedell

Reputation: 13404

If the branch already exists in the repository, it should just be:

git push origin branch_name

Upvotes: 8

Greg Hewgill
Greg Hewgill

Reputation: 992717

To do this you use a refspec, as explained in the git push documentation. For example:

git push origin local_branch_name:remote_branch_name

Upvotes: 71

Related Questions