您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
Git管理远程仓库
发布时间:2019-05-02 17:31:22编辑:雪饮阅读()
想要本地仓库与远程仓库,即github中的仓库同步,则前提是本地仓库是基于远程仓库检出的基础上进行操作了的。
注意:将本地仓库全部删除(连同.git的文件夹也删除)后无需重新进行初始化工作即可检出
查看配置
$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
credential.helper=manager
user.name=xueyin220807
user.email=1509272975@qq.com
检出
检出的地址就是你github中项目clone的地址,检出如:
$ git clone https://github.com/xueyin220807/snowDrink.git
Cloning into 'snowDrink'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), done.
同步到远程仓库
检出后我们进入仓库目录建立新文件并同步到远程仓库
$ cd snowDrink/
$ touch 220807.php
$ git add 220807.php
$ git commit -m 'this is 220807'
同步到远程仓库
$ git push
此时可能会弹出一个交互式的窗口,要求你输入你的github账号、密码
然后同步成功输出如下信息:
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 275 bytes | 275.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/xueyin220807/snowDrink.git
130096a..51624aa master -> master
关键字词:git,仓库,远程
下一篇:Git基本工作流程