简体   繁体   中英

"Branching"/"Forking" a framework repo that you own?

So I'm working on a game engine / framework. It functions like Laravel in that you work within the original directory structure (mainly in dedicated "App" folder).

I would like to be able to use this framework in such a way where if the original were to update, I can pull the changes, similar to a branch. However this is a separate project created theoretically by other users, so it must be in a different repo.

How can I do this with git?

I can pull the changes, similar to a branch

Since you cannot fork your own repository, you can simply:

  • clone it
  • rename origin to upstream (to keep a reference to the original repository)
    git remote rename origin upstream
  • add the URL of a new empty repository and push everything
    git remote add origin https://url/new/empty/repo git push --all

At any point, you can git fetch upstream and merge for instance upstream/master to your own branch in your second repo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM