# git_study **Repository Path**: sunlin-git/git_study ## Basic Information - **Project Name**: git_study - **Description**: sunlin-git的第一个仓库 - **Primary Language**: Python - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-01 - **Last Updated**: 2021-09-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **使用gitee进行代码托管** # 1.使用ssh公钥免密登录 * ssh-keygen命令: 安装git软件并将~/Git/usr/bin添加到系统变量 * 生成私钥/公钥对:ssh-keygen -t ras -C "sunlinyouxiang@163.com" * 复制公钥内容:打开~/.ssh/id_rsa.pub,复制公钥内容到粘贴板 * 上传公钥内容:点击ssh公钥选项,命名公钥标题,并粘贴公钥内容到“公钥”栏 * 测试免密登录:ssh -T sunlin-git@gitee.com, 显示成功即可 * 配置User: git config --global user.name "sunlin-git" * 配置User: git config --global user.email "sunlinyouxiang@163.com" # 2.使用方式一:新建-clone-push-pull * 新建:在gitee上新建一个仓库xxx.git * //使用git开头的链接(ssh链接)可以免密登录,使用https开头的要输密码 * //clone: git clone https://gitee.com/sunlin-git/git_study.git * clone: git clone git@gitee.com:sunlin-git/git_study.git * add: git add . * rm: git rm xxx.py # add/rm->commit->push * commit: git commit -m "update message" * push: git push # 上传本地文件并与远程仓库合并 * pull: git pull # 拉取远程仓库并与本地文件合并 # 3.使用方式二:新建/已有-关联-提交 * 新建:在gitee上新建一个仓库xxx.git * init: git init * add: git add . * rm: git rm xxx.py # add/rm->commit->push * commit: git commit -m "update message" * //使用git开头的链接(ssh链接),可以免密登录 * remote add: git remote add origin git@gitee.com:sunlin-git/git_study.git * push: git push origin master