Subodha Fernando
Subodha Fernando

Reputation: 1

What is the git command to push an existing project to an existing git repository branch?

I'm quite new to git and got confused with git commands. I have a project and I need to push it to an existing git repository branch. It is not the master branch but another separate branch that I have asked to work on. Please help me. Thanks!

Upvotes: 0

Views: 79

Answers (1)

architrex
architrex

Reputation: 191

After you've created a commit, push it to a branch via:

git push <remote name> <branch name>

If you haven't added the remote repository to your current environment yet, add it via:

git remote add <remote name> <URL>

Where <remote name> is a name you choose (conventionally "origin", referring to the remote repository as the origin of all source), and the <URL> is the URL of the remote repository that you were given.

Upvotes: 1

Related Questions