Git 基本操作


Git 工作流程

Git 常用的命令:git clone、git pull、git checkout、git add 、git commit、git push。

使用示例

1、git init 初始化

$ git init

2、git clone 克隆

git clone git@gitee.com:feiqiangsheng/my-project.git

3、git fetch 拉取分支

git fetch

4、切换分支

git checkout develop

5、git pull 拉取代码

git pull

6、git status 文件状态

git status

7、git add 添加文件到暂存区

git add .

8、git diff 查看暂存区和工作区的差异

git diff 111.txt

9、git commit 提交暂存区到本地仓库

 git commit -m "第一次提交"

10、git push 推送代码到远程仓库

git push
Git