Git仓库命令

git 仓库常用命令清单,包括git init git clone git log

1 git-init

# 创建git仓库
git init

它会在当前目录下生成一个.git隐藏目录,表示本地仓库创建成功

2 git-clone

# 从远程仓库克隆所有分支
git clone <remote-url> [local-name]

# 从远程仓库克隆单分支
git clone -b <remote-branch> --single-branch <remote-url>

3 git-log

# 以单行格式,查看仓库提交历史
git log --oneline

参考资料

更新日志

  • 20250315:初稿

  • 20241218:创建