上传项目到GitHub,同步远程Github仓库

最近在写一个简单的Android项目,不过由于人员管理上松散,所以决定把代码提交至GitHub,提前感受一下一直很火的GitHub。

上传项目到GitHub,同步远程Github仓库

历程简述:

1、本来想偷懒,看看有没有类似subversion,简单操作的团队开源工具,不过之前是在Javaweb方向上使用,在移动开发上当然用适合的工具了,于是舍弃之

2、再一想,有莫有eclipse的插件,集成上传,下载github上的源码呢?参考(使用GitHub管理Eclipse分布式项目开发 ),但是说的不是很详细,因为我的eclipse是最新google公司的版本,安上插件会报错,而且启动界面也会有变化,捣鼓了2个小时,但是仍然没有头绪,又舍弃之。

3、最后,我安定思痛,想想我想要的流程是什么?

上传本地代码->github网站

团队其他人从上面拷贝下来

改完之后再提交上去

于是google之,

再参考下面这几篇文章

在GitHub上分享和展示你的代码 

Git/Github使用方法笔记

下面的代码是记录记录而已,有兴趣的可以看一下,时间比较仓促,还望多多够沟通,一起在github上关注、学习大牛们!

Welcome to Git (version 1.8.3-preview20130601)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.

Administrator@VAIO-11061700 /d/GitHub/RescueApp
$ git config --global user.name "jptiancai"

Administrator@VAIO-11061700 /d/GitHub/RescueApp
$ git config --global user.email mail_jzy@163.com

Administrator@VAIO-11061700 /d/GitHub/RescueApp
$ ssh-keygen -C 'mail_jzy@163.com' -t rsa

Administrator@VAIO-11061700 /d/GitHub/RescueApp
$ ssh-keygen -C 'mail_jzy@163.com' -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Documents and Settings/Administrator/.ss
h/id_rsa):
/c/Documents and Settings/Administrator/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Documents and Settings/Administrator/.s
sh/id_rsa.
Your public key has been saved in /c/Documents and Settings/Administrator/.ssh/i
d_rsa.pub.
The key fingerprint is:
9f:be:0c:2e:de:a5:5f:2b:86:3e:73:1d:33:71:60:ab mail_jzy@163.com

Administrator@VAIO-11061700 /d/GitHub/RescueApp
$ git init
Initialized empty Git repository in D:/GitHub/RescueApp/.git/

Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
$ git add .
warning: LF will be replaced by CRLF in AndroidManifest.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in gen/com/yonvoo/main/BuildConfig.java.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in proguard-project.txt.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in project.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/values-v11/styles.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/values-v14/styles.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/values/strings.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/values/styles.xml.
The file will have its original line endings in your working directory.

Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
$ git remote add origin git@github.com:jptiancai/RescueApp.git

Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
$ git push origin master
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Administrator@VAIO-11061700 /d/GitHub/RescueApp (master)
$ git push origin master
The authenticity of host 'github.com (204.232.175.90)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,204.232.175.90' (RSA) to the list of know
n hosts.
error: src refspec master does not match any.
error: failed to push some refs to 'git@github.com:jptiancai/RescueApp.git'

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/16131.html