欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

git的命令备忘

程序员文章站 2022-07-15 11:28:45
...

1.clone a branch from git origin:

git clone -b develop git@192.168.1.1:project

2.create a new feature branch from this branch

git checkout -b feature-001 develop (从develop分支切出一个名为feature-001的分支,并切换到该分支)

3.finish

git checkout develop (切换当前分支到develop)

git pull (更新本地分支)

git diff --name-status develop feature (比较两个分支的改动文件)

git diff develop feature (详细比较两个闻之的改动文件)

4.merge back

git merge --no-ff  feature-offline-msg-store (把feature分支合并到当前分支)

5.push to origin

git push origin develop (把develop分支推送到远程)

6.delete local branch

git branch -d feature(删除本地分支)

7.delete remote branch

git push origin --delete feature(删除远程分支)