Git 笔记 git clone12345678git clone:git clone http://xxxx.git # 默认master分支git clone -b <branch_name> http://xxxx.git # clone指定分支# clone 特定版本/分支git clone -branch <branch-name> <repo-address> # 克隆特定分支git tag # 列出全部tag(先clone全部仓库)git checkout <tag> # 切换到指定tag(版本) 连接仓库 remote123git remote -v # 查看当前连接git remote remove origin # 删除现有连接git remote add origin 你的远程库地址 # 把本地库与远程库关联 git 提交12345678910111213# 第一次提交git init # 初始化版本库git add . # 添加文件到版本库(只是添加到缓存区),.代表添加文件夹下所有文件git add -f <路径> # 添加被忽略文件git commit -m "first commit" # 把添加的文件提交到版本库,并填写提交备注git push -u origin master # 第一次推送时git push # 第一次推送后,直接使用该命令即可推送修改# 后续提交git add .git commit -m "message"git push origin mastergit push origin <new-brance> # master无法访问时用新分支 new-branch 远程更新代码12git pull origingit pull origin <branch> # 初次, 指定分支 分支操作12345git branch --list # 查看分支git branch -m new-name # 分支重命名git checkout <branch-name> # 切换到分支git checkout -b <branch-name> # 新建分支git merge target_branch # 将目标分支合并到当前分支 开发笔记 #开发 #git Git 笔记 https://guokent.github.io/developnotes/git/ 作者 Kent 发布于 2024年12月23日 许可协议 Python 上一篇 CLIP 下一篇