git常用命令

提交

1、git init

初始化(使文件夹变成厂库 )

2、git add -A

将工作区内容提交到暂存区

3、git commit -m “first commit”

将暂存区内容提交到厂库

4、git log –stat

查看历史

5、git checkout <文件名>

工作区打回去

6、git reset HEAD^

提交后撤回

分支

1、git checkout -b

从当前节点建立分支

2、git branch

单纯地切换到某个分支

3、git branch -D

删除特定的分支

4、git merge

合并分支

5、git checkout main

回到主分支

6、git branch

查看分支

Git与Github远程厂库

1、git push

将本地推送至远程

2、git pull

从远程拉取回本地

上传至Github

1、git branch -M main

2、git push -u origin main

  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2022-2024 祝小炉
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信