linux 使用git实践

1.安装git: yum install git -y

2.生成ssh公钥:ssh-keygen -t rsa (一路回车)

3.进入.ssh目录,查看公钥内容,并复制:cd ~/.ssh/ ;cat  id_rsa.pub

4.创建本地git目录,并初始化:mkdir git ; cd git ; git init

5.web上打开国内的git托管服务,登入后,右上角个人信息--设置,在安全信息中找到ssh公钥,黏贴进去


6.gitee首页,点此添加项目,填入项目名称,并记录项目仓库的地址


6.回到git初始化目录git/,添加远程仓库:git remote add origin [email protected]/...

7.查看是否添加成功:git remote -v

8.git config设置,按提示操作即可

9.下载远程仓库到本地:git clone [email protected]...

10.然后使用“git add .;git commint  -m "随便写写啥";git push ”三连,便可向远端仓库进行提交

其他

11.git删除远程仓库的文件或目录https://www.cnblogs.com/toward-the-sun/p/6015284.html

猜你喜欢

转载自blog.csdn.net/qq_15742255/article/details/80135143