添加个性化交互信息
点击删除,删除本地仓库,然后复制远程仓库,按照上面的步骤进行复制远程仓库
-使用TortoiseGit
安装TortoiseGit,默认安装就可以满足所有要求,并且之前已经安装和设置过Windows的git,所以安装时全部选择默认的即可
TortoiseGit的汉化包同样全部下一步
添加到暂存区
点击推送,推送到远程仓库
-使用Github
GitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名GitHub。
GitHub于2008年4月10日正式上线,除了Git代码仓库托管及基本的 Web管理界面以外,还提供了订阅、讨论组、文本渲染、在线文件编辑器、协作图谱(报表)、代码片段分享(Gist)等功能。目前,其注册用户已经超过350万,托管版本数量也是非常之多,其中不乏知名开源项目 Ruby on Rails、jQuery、python 等。
GIT服务器并不需要我们搭建,我们使用github就可以满足我们的需求
#生成密钥 [root@git ~]# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:it268x6RVv9esC4hxQ8XHtcl1AmauD9CG4ZASn1YuBY root@git The key's randomart image is: +---[RSA 2048]----+ | ...+. o+.=| | . oE . . o oo+| | . .+ ..+ . + | | o. .o..+ o | | . .S= ..+. | | o +o.= ...o | | . o oo + .o .| | .. .. oo . | | o=o .o | +----[SHA256]-----+ [root@git ~]# cat .ssh/id_rsa.pub #查看密钥 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC54DY7BCQ04clFqFwSToMFUf1fU2w7FVuzVkqg8rUSGmjohh2Dy6ViPI0q1A23FW0KExGw+3kSDgz5wEsU5wjfqrrNySXI2xEcsTZZqYZv2hIlMavfXD74pqiHy1g2fjSLfnsneN3a1aPyETbq0wYSjz4nHzIFFrflDnKb1n0JsfHqUstgp3AHRgOG2hI75LbTWO3I9lLz+3rC5i6YEMFYPBPhVneLiboKA3E3cFWhcr/yjeVi3XcdWW3Q7MjI/3/txNwWIYBMIdZKkHuFHs1g4OhKmadEy60yPOicoL0MSMyiLRmD9C25weM7limmAN93BsbhIa24Hiq+DOxGGzoT root@git
点击设置
成功添加
-测试在git机器上登录
[root@git ~]# ssh -T git@github.com The authenticity of host 'github.com (13.229.188.59)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. RSA key fingerprint is MD5: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)? yes Warning: Permanently added 'github.com,13.229.188.59' (RSA) to the list of known hosts. Hi renzeyuan! You've successfully authenticated, but GitHub does not provide shell access.
-新建存储库
创建存储库以后,GitHub会提示我们相关仓库操作,一种是我们本地没有仓库,需要先创建再推送,另一种就是我们本地已经有了仓库,直接推送上去就行了
-客户端工作流程
[root@git ~]# mkdir git-test [root@git ~]# cd git-test/ [root@git git-test]# echo "aaa" > abc.txt [root@git git-test]# git init 初始化空的 Git 版本库于 /root/git-test/.git/ [root@git git-test]# git add abc.txt [root@git git-test]# git commit -m "abc" *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got 'root@git.(none)') [root@git git-test]# git config --global user.name "renzeyuan" [root@git git-test]# git config --global user.email "1248873545@qq.com" [root@git git-test]# git commit -m "abc" [master(根提交) de847c9] abc 1 file changed, 1 insertion(+) create mode 100644 abc.txt [root@git git-test]# git remote add origin https://github.com/renzeyuan/test.git #把本地仓库和远程仓库连接 [root@git git-test]# git push -u origin master Username for 'https://github.com': renzeyuan #输入账户 Password for 'https://renzeyuan@github.com': #输入密码 Counting objects: 3, done. Writing objects: 100% (3/3), 208 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/renzeyuan/test.git * [new branch] master -> master 分支 master 设置为跟踪来自 origin 的远程分支 master。 #显示成功