linux提交git代码

2020-04-30   581 次阅读


1.提交代码到本地仓库

[root@yoyo git_code]$ git add *                 #*是提交当前文件夹下全部的,也可以指定提交一个文件如:test.py

2.代码提交到缓存区

[root@yoyo git_code]$ git commit -m "add test.py"

3.提交到远程仓库

[root@yoyo git_code]$ git remote add origin
http://52.221.x.x:8100/root/yoyo.git

4.最后一步push推送过去

[root@yoyo git_code]$ git push -u origin master  #push的时候,会让你输入账号和密码,这里的用户名和密码就是gitlab上注册的用户了

脑无理想 枉活一世