更新github上的代码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_23101033/article/details/77310930

昨晚熬夜写完了“git上传本地项目代码到github”的任务,早上来公司先把早上的工作完成后,抽点时间继续来继续更新文章

更新github上的代码

一、克隆代码

1、把大神的代码clone到本地,或者clone自己github上的代码使用命令

git clone https://github.com/gubai/gubai.git
2、在本地随便建一个文件夹,在地址栏输入cmd打开,然后输入上面的命令


二、git status查看状态
1、查看当前的git仓库状态,可以使用git status

>git status
2、如果是在刚才新建的文件夹输入git status 会提示你git目录不对
3、先用cd命令切换到gubai这个repository目录
4、再输入git status可以看到On branch master,这个说明已经在master分之上了

三、更新代码
1、在gubai文件夹下更细东西,比如我上传一个脚本文件(139_login.py)


2、更新后使用git add * --代表更新全部

>git add *
3、接着输入git commit -m "更新说明",commit只是提交到缓存区域

>git commit -m "更新说明”


4、如果多人同时开发维护代码,得先git pull,拉取当前分支最新代码

>git pull
5、最后git push origin master,最后一步才是push到远程master分支上

6、打开github界面就能看到同步了


猜你喜欢

转载自blog.csdn.net/qq_23101033/article/details/77310930