github新建仓库并上传

执行过程中的相关参考链接:

http://stackoverflow.com/questions/18328800/github-updates-were-rejected-because-the-remote-contains-work-that-you-do-not-h(Github “Updates were rejected because the remote contains work that you do not have”

http://blog.csdn.net/dengjianqiang2011/article/details/9260435(github常见操作和常见错误!错误提示:fatal: remote origin already exists.)

http://www.cnblogs.com/rubylouvre/archive/2013/01/24/2874694.html(如何在github上fork一个项目来贡献代码以及同步原作者的修改)

http://site.douban.com/196781/widget/notes/12161495/note/269163206/(花20分钟写的-大白话讲解如何给github上项目贡献代码)

http://blog.csdn.net/jrainbow/article/details/16858547(git 删除分支和删除文件夹)(同步操作

http://git-scm.com/book/zh/v1/%E8%B5%B7%E6%AD%A5-%E5%88%9D%E6%AC%A1%E8%BF%90%E8%A1%8C-Git-%E5%89%8D%E7%9A%84%E9%85%8D%E7%BD%AE(github教程

 

 

1. 首先,设置全局变量:

git config --global user.name "[your name]"
git config --global user.email "[your email]"

([]内部的是需要你手动填的)

--- 如果是fork别人的代码、别人一起编写(合作者collaborator)时,只有像上面这样操作,贡献者才会是你输入的用户(上面输入的用户)

 

2. 初始化git

git init

 

3. 与github仓库建立连接:

git remote add origin [remote repository URL]

([]内部的是需要你手动填的)

可以通过:

git remote -v

查看

 

4. 加载github仓库到本地

git pull origin master

 

5. 更新本地文件(win下操作,复制粘贴之类的)

 

6. 加载并提交本地文件

git add .
git commit -m "[input a name]"

([]内部的是需要你手动填的)

 

7. push本地仓库到github仓库

git push origin master

(之后输入用户名和密码即可)(这里不知为何要输入,因为提交后,显示的提交者与之无多大关系,反而是与上面的第一步中的有关系)

posted @ 2015-06-17 01:50  昭瑶  阅读(480)  评论(0编辑  收藏  举报