1 .下载git并使用命令:
1 yum install git 2.配置git :
1 git config---- global user.name ' your name '2git config---- global user.email ' email @ example.com '3#配置是否有效
创建1 #目录2 mkdirgitspace3cdg itspace4git init此时,git的本地仓库已完成。 请测试一下:
创建一个自述文件,然后单击git status ./
git add此文件:
1 #git add .添加所有文件2 git add readme,在git status中显示:
自述文件已添加到暂存区,但尚未提交到本地仓库
使用git commit提交:
1 git commit -m 'add readme '
提交后确认,本地没有需要提交的记录。
4 .远程仓库配置:
1 )首先在自己的linux服务器上本地生成ssh密钥,然后使用命令“ssh-keygen-trsa-c ' your_email @ your email.com '”,your _ email很少见
2 )在github中注册新用户,注册成功后,在settings中设置ssh key :
settings:
要设置ssh密钥:
shkey是上一个服务器的id_rsa.pub,在key中打开整个副本:
添加成功后,单击编号添加仓库“新建资源库”
输入仓库名称并保存
保存成功后,进入项目。 里面有很多git命令的提示。 根据命令,
按上述方法提交远程仓库。
然后更新工程审查。
自述文件已经上传到github上。
转载于:https://www.cn blogs.com/daniao fighter/p/9452661.html