text Git分支和合并

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Git分支和合并相关的知识,希望对你有一定的参考价值。

https://guides.github.com/introduction/flow/

See which branch you're on:
$ git status

List the branches
$ git branch

Create a branch and switch to it:
$ git branch <branch-name>
$ git checkout <branch-name>
- or shorthand -
$ git checkout -b <branch-name>

Work on/edit some files, then add them & commit them
$ git add .
$ git commit -m "Your commit message here"

When ready to merge the new branch into master:
// switch to 'master' / move into the branch you want to merge into
$ git checkout master
$ git merge <branch-name>

To push the branch
$ git push origin <branch-name>

To delete a local branch
$ git branch -d <branch-name>

To delete branch from online repo
$ git push origin --delete <branch-name>

To remove a remote branch (if you know what you are doing!)
$ git push <remote-name> --delete <branch-name>

以上是关于text Git分支和合并的主要内容,如果未能解决你的问题,请参考以下文章

text 在项目目录中显示合并的git分支

git合并分支操作

text 清理项目目录中的合并git分支(首先使用show_clean函数查看将删除的内容)

Git文件合并

git分支的合并

Git 分支合并