学习Git第四天

1、$ git remote add origin [email protected]:michaelliao/learngit.git

讲本地的仓库与github上面的仓库绑定,这样之后才可以讲本地仓库代码提交到远端仓库,就想一条管道,连接她两。

2、 $ git push -u origin master

$ git push -u origin master // 把本地库的内容推送到远程,用git push命令,实际上是把当前分支master推送到远程。由于远程库是空的,我们第一次推送master分支时,加上了-u参数,Git不但会把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来,在以后的推送或者拉取时就可以简化命令。即省略-u。
Counting objects: 19, done. // 对象总计:19,完成。
Delta compression using up to 4 threads. // 使用四个线程进行增量压缩
Compressing objects: 100% (19/19), done. // 压缩对象:100%(19/19),完成。
Writing objects: 100% (19/19), 13.73 KiB, done. // 写入对象:100% (19/19), 13.73KiB,完成。
Total 23 (delta 6), reused 0 (delta 0) // 总计23(6),重用0(0)
To [email protected]:michaelliao/learngit.git // 到你的github仓库
 * [new branch]      master -> master // 从本地master分支到远端master分支
Branch master set up to track remote branch master from origin. // 设置本地master分支绑定追踪远端master分支

3、 $ git clone 你的github仓库的地址,注意是你要clone的仓库地址

$ git clone [email protected]:michaelliao/gitskills.git // 将这个github仓库代码复制到本地仓库。
Cloning into 'gitskills'... // 复制"你的项目"中...
remote: Counting objects: 3, done. // 远端:对象数量:3,完成。
remote: Total 3 (delta 0), reused 0 (delta 0) // 远端:总计3(0),重用0(0)。
Receiving objects: 100% (3/3), done. // 对象接收:100%(3/3),完成。

你可能感兴趣的:(学习Git第四天)