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

时间:2017-07-10 15:21:52

标签: git github gitlab git-push

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!

1 个答案:

答案 0 :(得分:1)

在您创建提交后,通过以下方式将其推送到分支机构:

git push <remote name> <branch name>

如果您尚未将远程存储库添加到当前环境中,请通过以下方式添加:

git remote add <remote name> <URL>

<remote name>是您选择的名称(通常&#34; origin&#34;,将远程存储库称为所有源的来源),<URL>是其中的URL您获得的远程存储库。