养浩然之气,做博学之人
可以参考 安装Git并创建本地库
首先创建一个仓库。如:PythonDemo
此时需要注册一个GitHub账户(如果没有的话)
打开Git Bash,并进入本地版本库项目目录:
cd D:/PythonProjects/Demo
将本地库push到远程服务器GitHub上:
git remote add origin https://github.com/xiaowangyun/PythonDemo.git git push -u origin master
#输入远程服务器GitHub账户和密码,登录成功后自动上传,输出如下
Enumerating objects: 28, done.
Counting objects: 100% (28/28), done.
Delta compression using up to 4 threads
Compressing objects: 100% (25/25), done.
Writing objects: 100% (28/28), 11.21 KiB | 883.00 KiB/s, done.
Total 28 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), done.
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote: https://github.com/xiaowangyun/PythonDemo/pull/new/master
remote:
To https://github.com/xiaowangyun/PythonDemo.git
* [new branch] master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
此时在Github上创建的空版本库便有了本地库中的东西,并且可以方便查看修改记录
在修改之后,先commit 然后push到GitHub.
提交修改:
git commit -am "增加目录"
[master cd8f318] 增加目录
1 file changed, 39 insertions(+), 7 deletions(-)
rewrite README.md (67%)
将修改Push到GitHub
git push -u origin master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 666 bytes | 666.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/xiaowangyun/PythonDemo.git
66e62ec..cd8f318 master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
此时,便可在GitHub上看到提交记录了。
编辑:孙小北
本文地址: https://www.xiaowangyun.com/wyblog/detail/?id=1033
版权归属: www.xiaowangyun.com 转载时请以链接形式注明出处
0 条评论