git 批量删除git分支
It is common to set up git servers to host git repositories. Branching is lightweight in git and a very friendly mechanism to manage code. Here, I summarize a cheatsheet of common git branching commands for working on repositories from a git server. This post assumes that you have basic knowledge with git. If you are not familiar with git, you may want check Howto for New Git Users first.
设置git服务器来托管git存储库是很常见的。 分支在git中是轻量级的,并且是一种非常友好的代码管理机制。 在这里,我总结了一些通用git分支命令的速查表,这些命令可用于git服务器上的存储库。 这篇文章假定您具有git的基本知识。 如果您不熟悉git,则可能需要先查看“新Git用户的操作方法” 。
克隆仓库∞ (Clone a repository ∞)
$ git clone git://example.com/your/repo.git
列出所有本地分支∞ (List all local branches ∞)
$ git branch -a
更新所有分支∞ (Update all branches ∞)
$ git pull
更改为分支∞ (Change to a branch ∞)
$ git checkout rc
创建并推送新分支∞ (Create and push a new branch ∞)
$ git branch dev-b1
$ git checkout dev-b1
$ git push origin dev-b1
创建一个分支并立即将其签出∞ (Create a branch and immediately check it out ∞)
$ git checkout -b dev-b1
在某个分支上推送更改∞ (Push changes at a certain branch ∞)
$ git push origin dev-b1
将所有更改推送到所有分支∞ (Push all changes to all branches ∞)
$ git push
合并一个分支到另一个分支∞ (Merge a branch to another branch ∞)
$ git checkout rc
$ git merge dev-b1
$ git push origin rc
合并来自另一个分支的单个提交∞ (Merge individual commits from another branch ∞)
$ git cherry-pick refnumber
翻译自: https://www.systutorials.com/cheatsheet-git-branching-with-a-git-server/
git 批量删除git分支