git remote add test http://[email protected]/scm/wbqa/xxxx.git # test 为远程仓库别名 后面http 为远程仓库地址
6.配置完成后,可使用 git remote -v 命令查看是否生效
1
git remote -v
7.创建分支
1
git branch web
8切换到新建的分支
1
git checkout web
8.使用push命令,将代码提交到远程仓库分支
1
$ git push test web
如果出现如下错误
1 2 3 4 5 6
! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/xx/xxx' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards'in'git push --help'for details.
评论