Skip to content

命令行方式将 fork 项目与上游项目同步 #182

@Dream4ever

Description

@Dream4ever

搜索路径

关键词:git forked repository update from original repository

解决方案

How do I update or sync a forked repository on GitHub?

主要流程

# 1. 添加上游项目
git remote add upstream https://github.com/whoever/whatever.git

# 2. 获取上游项目所有分支
git fetch upstream

# 3. 自己 fork 出来的项目切换到主分支
git checkout main

# 4. rebase 自己的分支
git rebase upstream/master

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