# git常用基本操作

git常用基本操作

  1. 初始化git仓库git init
  2. 从远程仓库克隆git clone <远程仓库地址>
  3. git到暂存区git add .
  4. git提交git commit -m "<提交信息>"
  5. git提交到同步到远程仓库git push <远程仓库/仓库名>
  6. git查看提交历史git log ,在一行查看git log --pretty=oneline
  7. git查看所有分支git branch -l
  8. git创建分支git branch <新分支名>
  9. git从某个提交历史创建分支git branch -b <哈希>
  10. git和某个本地分支合并git merge <分支名>
  11. git切换所在分支git checkout <分支名>
  12. git回滚提交历史git reset --head <哈希>
  13. git添加远程仓库git remote add <仓库名> <远程仓库地址>

持续更新

猜你喜欢

转载自www.cnblogs.com/freesfu/p/11674060.html