github上传

创建全局的name和email

1.创建ssh(使用命令)
$ssh-keygen -t rsa -C xxxxx@gmail.com(注册github时的email)
2.在github中添加ssh

 

 

登陆github,选择Account Settings-->SSH  Keys 添加ssh

Title:xxxxx@gmail.com

Key:打开你生成的id_rsa.pub文件,将其中内容拷贝至此。
3.打开终端,先测试一下你的帐号跟github连上没有:ssh -T git@github.com 如果出现如下提示,表示你连已经连上了.(因为有了第一步,所以不用自己做过多的连接github的操作了,另外,下一次要连接github的时候记得打开第一步的工具).Hi MiracleHe! You've successfully authenticated, but GitHub does not provide shell access.

Hi "username"! You're successfully authentiated,but GitHub does not provide shell access

4 输入命令:git config --global user.name "注册的用户名"

5 输入命令:git config --global user.email "注册的邮箱"

 


touch README.md //新建说明文件
git init //在当前项目目录中生成本地git管理,并建立一个隐藏.git目录
git add . //添加当前目录中的所有文件到索引
git commit -m "first commit" //提交到本地源码库,并附加提交注释
git remote add origin https://github.com/chape/test.git //添加到远程项目,别名为origin
git push -u origin master //把本地源码库push到github 别名为origin的远程项目中,确认提交

更新代码
cd /d/TVCloud
git add .
git commit -m "update test" //检测文件改动并附加提交注释
git push -u origin master //提交修改到项目主线

 

github常用命令
git push origin master //把本地源码库push到Github上
git pull origin master //从Github上pull到本地源码库
git config --list //查看配置信息
git status //查看项目状态信息
git branch //查看项目分支
git checkout -b host//添加一个名为host的分支
git checkout master //切换到主干
git merge host //合并分支host到主干
git branch -d host //删除分支host

.gitignore  忽略一下文件和目录

*.suo
debug/
obj/
*.gitignore

忽略之后上传如下

git GUi界面操作,不使用命令:

当前目录下 右键点击 看到 git gui here 和 git base here(命令界面)

Commit

意思说备注信息是必填项:

点击push

上传完成

 

 在github上查看

 

posted @ 2016-07-12 18:29  ligl007  阅读(489)  评论(0编辑  收藏  举报