一、创建github仓库

点击浏览器右上角的+ 号,选择New repository 开始创建一个仓库:

进入创建仓库页面,设置仓库的名字,下面可以选择自动创建一个README.MD 文件:

创建成功后会跳转到仓库首页,点击Clone or download 会出现该仓库的地址,浏览器当前地址栏中的地址也是这个地址。

二、克隆到本地并修改提交

复制上面的地址,使用git clone 克隆到本地:

> git clone https://github.com/madawang/intely  # 克隆到本地
Cloning into "intely"...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
> cd intely
> ll
total 4
-rw-r--r--. 1 root root 6 Dec 18 04:42 README.md  # 仓库中的readme.md文件
> vi README.md # 修改文件内容
# intely
Hey, how are you!
> git add README.md # 提交到暂存区
> git commit -m "modify README.MD" # 提交到版本库
[master 82f3254] modify README.MD
 1 file changed, 1 insertion(+), 1 deletion(-)
> git push # 提交到github
Username for "https://github.com": maqian@dyxmq.cn
Password for "https://maqian@dyxmq.cn@github.com": 
Counting objects: 3, done.
Writing objects: 100% (3/3), 280 bytes | 280.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/madawang/intely
   f5042e1..82f3254  master -> master

查看github中的README.MD 文件,文件已经被改变:

最后修改:2018 年 12 月 16 日
如果觉得我的文章对你有用,请随意赞赏