命令行要先进入想要操作的目录下
克隆仓库(命令行要先进入想要clone到的目录下):git clone 仓库地址(ssh地址)
clone时把submodule一起clone下来:git clone --recursive 仓库地址(ssh地址)
若clone完发现submodule依然是空的,可以用以下指令继续clone:git submodule update --init --recursive
一次全部更新所有的 submodule:git submodule foreach --recursive git pull origin master
取回远程主机某个分支的更新,再与本地的指定分支合并:git pull
对大文件进行操作:git lfs命令,如更新即 git lfs pull
查看目前文件夹内文件和仓库文件有哪些变更:git status
进阶篇:
git branch 查看本地代码分支
git branch -r 查看云端代码分支
git commit -b xxx 创建分支
git push origin xxx 合流分支代码到主干,之后在云端通过合流请求就可以合并到主干
git branch -D xxx 删除分支
提交代码步骤:1、git add . 2、git commit -m “xxx” 3、 git push
git checkout . 回滚本地所有改动
git checkout xxx 代码切换到xxx分支