Skip to content

Git 常用命令 #5

Description

@OnedayLiu

本地分支关联远程分支 详细

Given a branch foo and a remote upstream:
As of Git 1.8.0:
git branch -u upstream/foo

删除分支 详细

删除本地分支
git branch -d <branch>
强制删除本地分支
git branch -D <branch>
删除远程分支
git push origin --delete <branch>

创建分支

创建并查看 <new-branch>-b 选项是一个方便的标记,告诉 Git 在运行 git checkout <new-branch> 之前运行 git branch <new-branch>
git checkout -b <new-branch>

Tag

git tag <tagname>
  • 将 tag 推送到远程
git push origin <tagname>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions