Git的使用-->

1.到github注册账号,创建代码仓库,得到仓库地址;

2.使用clone或create respository + pull 方式创建本地仓库;

3.把仓库地址添加到git的服务器列表中;

4.在本地仓库目录中新建代码文件或拷贝工程文件到仓库目录中;

5.如果没有设置用户名和email,第一次增加代码时会提示设置,随便设置即可;

6.选中需要添加的文件或文件夹,add-->commit-->push,push时输入github上注册的账户密码;

7.如果需要记住用户名密码,在C:\Documents and Settings\Administrator\ 目录下有一个  .gitconfig 的文件,添加下面两行

[credential]       
helper = store 

//--------------------------------------------------------------

studio中直接操作git:

1.check out project form version control->github

2.填入github上注册的用户名密码,选择clone

3.clone完成后, 提示是否创建工程,选择no

4.在主界面选择open an existing android studio project,打开工程

5.打开后,如果没有出现version control页,点击底下的错误提示,出现提示:The directory xxxxxx is under Git, but is not registered in the Settings.根据提示点击add root即可解决

posted @ 2016-03-06 19:46  awayaaaaaaaa  阅读(294)  评论(0编辑  收藏  举报