远程仓库
创建和绑定
1、在远程仓库中创建一个仓库 2、需要在本地验证是否是本人的操作 一般是使用 SSH公钥
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
ssh -T git@gitee.com
3、告诉本地仓库,所对应的远程仓库是哪一个
git remote add origin <ssh-address>
git remote
代码同步
git push origin master
git push origin master:master
git push --set-upstream orgin master:master
git branch -vv
fengxuewei@fengxuewei-Legion-Y7000-2019-PG0:~/gitTest$ git push origin master:master
Everything up-to-date
fengxuewei@fengxuewei-Legion-Y7000-2019-PG0:~/gitTest$ git branch -vv
dev 362870e file.txt count = dev
* master 80fca34 Merge branch 'dev'
fengxuewei@fengxuewei-Legion-Y7000-2019-PG0:~/gitTest$ git push --set-upstream origin master:master
Warning: Permanently added the ECDSA host key for IP address '180.97.125.228' to the list of known hosts.
Branch 'master' set up to track remote branch 'master' from 'origin'.
Everything up-to-date
fengxuewei@fengxuewei-Legion-Y7000-2019-PG0:~/gitTest$ git branch -vv
dev 362870e file.txt count = dev
* master 80fca34 [origin/master] Merge branch 'dev'
|