Skip to content

git_远程仓库 #3

@lastorder

Description

@lastorder

查看远程仓库
git remote -v
查看远程仓库详细信息
git reomte show origin

查看远程分支
git branch -a
查看当前分支跟踪分支
git branch -vv

添加远程仓库
git remote add pb https://github.com/paulboone/ticgit

创建对应的远程分支
git checkout -b branch-name origin/branch-name,本地和远程分支的名称最好一致,并切换当前分支
git branch -t branch-name origin/branch-name 创建远程跟踪分支,但不切换

建立本地分支和远程分支的关联
git branch --set-upstream-to=origin/branch-name branch-name
git branch -u origin/branch-name (localbranch) 默认为当前分支

取消upstream
git branch --unset-upstream (localbranch) 默认为当前分支

删除远程分支: (如果是默认clone分支,需要先取消默认)
$ git push origin --delete
或者 git push origin :

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