关于Github和一些Git命令(更新中)
来源:互联网 发布:win7 mac地址修改 编辑:程序博客网 时间:2024/06/06 00:04
生成你的Public Key
ssh-keygen –C “你的email地址 “ –t rsa
登陆github.Com 网站,在SSH Public Keys 设置你的SSH Public Keys (在id_rsa.pub 一般在~/.ssh文件夹下可以找到)
设置你的github 用户名:
git config --global github.user caijiamx
git config --global user.name "Firstname Lastname"
git config --global user.email "your_email@youremail.com"
设置你的git账户的token: (https://github.com/settings/applications#personal-access-tokens)
Git config --global github.token 0123456789yourf0123456789token
复制一个repository:
git clone git@github.com:alex/demo-project.git
Ref:
http://stackoverflow.com/questions/9287911/get-git-username-to-link-to-profile/9287955#9287955
http://www.xbc.me/install-git-on-windows/
http://www.xbc.me/git-commands/
Github上传代码菜鸟超详细教程
最近需要将课设代码上传到Github上,之前只是用来fork别人的代码。
这篇文章写得是windows下的使用方法。
第一步:创建Github新账户
第二步:新建仓库
第三部:填写名称,简介(可选),勾选Initialize this repository with a README选项,这是自动创建REAMDE.md文件,省的你再创建。
第四步:安装Github shell程序,地址:http://windows.github.com/
第五步:打开Git Shell,输入以下命令生成密钥来验证身份
ssh-keygen -C 'your@email.address' -t rsa
连续三个回车之后会在windows当前用户目录下生成.ssh文件夹,和linux一样。
把文件夹下的id_rsa.pub文件内容全部复制。
然后打开github账户设置,如图
打开ssh keys
右上角点击add ssh key
然后在title随便输入,key栏粘贴刚才的密钥。
第六步:在Git Shell下输入命令测试刚才的公钥是否认证正确。
ssh -T git@github.com
正确结果会显示:
Warning:Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts. Hi Flowerowl! You've successfully authenticated, but GitHub does not provide shell access.
warning 不用理会。
第七步:clone刚才新建的repository 到本地,输入命令:
git clone https://github.com/Flowerowl/stumansys.git
这时会在目录下生成:
第八步:将想上传的代码目录拷贝到此文件夹下:
第九步:切换到Git shell 命令行下,输入命令:
git init
git add .git commit -m 'stumansys'git remote add origin https://github.com/Flowerowl/stumansys.git (这步也许是多余的)git push origin master
如果执行git remote add origin
https://github.com/Flowerowl/stumansys.git
,出现错误:
fatal: remote origin already exists
则执行以下语句:
git remote rm origin
再往后执行git remote add origin https://github.com/Flowerowl/stumansys.git 即可。
在执行git push origin master时,报错:
error:failed to push som refs to.......
则执行以下语句:
git pull origin master
先把远程服务器github上面的文件拉先来,再push 上去。
最后,你可以去项目页面查看了~~代码上传成功!
http://lazynight.me/2898.html
http://artori.us/git-github-usage/
http://serholiu.com/github-share-code
- 关于Github和一些Git命令(更新中)
- 更新一些git命令
- 关于git、github和.gitignore的一些事
- 关于git与github的 小结(持续更新)
- GitHub使用流程- Git Shell 的一些命令总结(二) 创建代码库并学会更新
- git和github实用步骤记录,及git.oschina私有代码管理步骤记录(更新中)
- 关于iOS中git和github的使用
- 项目中用到的一些git命令(持续更新)
- git本地项目提交github命令及更新命令
- 关于github一些比较重要的命令
- Git 一些关于 Git、Github 的学习资源
- 对git和github的一些理解
- Git命令汇总和GitHub使用方法
- 使用Git命令从Github远程仓库更新项目
- 使用Git命令从Github远程仓库更新项目
- git更新到github
- github 学习笔记1--一些简单的git命令
- 使用git命令操作github时的一些注意事项
- Java 7之传统I/O - 字符类 CharArrayReader和CharArrayWriter
- Mysql+JDBC
- Linkedlist和Array实现Stack
- hdu1251 统计难题(字典树)
- 事业成功四条黄金法则
- 关于Github和一些Git命令(更新中)
- Linkedlist实现Queue
- LeetCode(112)Path Sum
- LeetCode(113)Path Sum II
- 目前的Android恶意软件分类
- ASPCMS详细页面和列表页面标签集锦
- poj 3114 Countries in War
- 各种sorting总结
- 禁止UITableView滚动