1. github是一个git项目托管网站注册地址:https://github.com/signup/free2. 安装git程序,执行下面操作$ cd ~/.ssh //检查计算机ssh密钥
如果没有提示:No such file or directory 说明你不是第一次使用git,执行下面的操作,清理原有ssh密钥 $ ls config id_rsa id_rsa.pub known_hosts $ mkdir key_backup $ cp id_rsa* key_backup $ rm id_rsa*
获得密钥:ssh-keygen -t rsa -C "defnngj@gmail.com"//填写email地址,然后一直“回车”ok
打开本地...sshid_rsa.pub文件。此文件里面内容为刚才生成人密钥。4. 登陆github系统。点击右上角的 Account Settings--->SSH Public keys ---> add another public keys把你本地生成的密钥复制到里面(key文本框中), 点击 add key 就ok了5. 接着打开git ,测试连接是否成功$ ssh -T git@github.com
如果提示:Hi defnngj You"ve successfully authenticated, but GitHub does not provide shell access. 说明你连接成功了6. 设置用户信息:6.1$ git config --global user.name "defnngj"//给自己起个用户名 $ git config --globla user.email "defnngj@gmail.com"//填写自己的邮箱
6.2在github中找到 Account Settings--->Account Admin ,找到一下信息:Your API token is e97279836f0d415a3954c1193dba522f ---keep it secret! Changing your password willgenerate a new token$ git config --global github.user defnngj //github 上的用户名 $ git config --globla github.token e97279836f0d415a3954c1193dba522f
====================创建一个项目========================1. 回到github首页,点击页面右下角“New Repository”填写项目信息:project name: hello worlddescription : my first project点击“Create Repository” ; 现在完成了一个项目在github上的创建。2. 我们需要使用git在本地创建一个相同的项目。$ makdir ~/hello-world //创建一个项目hello-world $ cd ~/hello-world //打开这个项目 $ git init //初始化 $ touch README $ git add README //更新README文件 $ git commit -m "first commit"//提交更新,并注释信息“first commit” $ git remote add origin git@github.com:defnngj/hello-world.git //连接远程github项目 $ git push -u origin master //将本地项目更新到github项目上去
现在查看github上面的hello world 项目,是不是发现已经将本地中的README文件更新上来了。 :) 恭喜! 可能的错误$ git remote addorigin git@github.com:defnngj/hello-world.git错误提示:fatal: remote origin already exists.解决办法:$ git remote rm origin然后在执行:$ git remote add origin git@github.com:defnngj/hello-world.git 就不会报错误了本文是参考官方帮助进行的:http://help.github.com/win-set-up-git/ 基本与官方步骤相同,我在此属于翻译了一下!Linux虚拟文件系统之文件打开(sys_open())Vi/Vim基本使用命令相关资讯 Git Linux教程
- Git 2.10 发布- Push、Worktree、 (09月21日)
- 使用Eclipse上传/下载Git项目 (05月29日)
- Git 2.8.2 发布,源代码管理系统 (05月03日)
| - Git 技能学习总结 (08月05日)
- Git诞生11年后,BitKeeper宣布开源 (05月11日)
- Git 联机版注册使用 (03月30日)
|
本文评论 查看全部评论 (0)