7
Parzi
6y

Is it okay for me to fork my own repo to an alt account so I can have my multi-branch repo but not have to commit everything to the production repo right away?

Comments
  • 5
    Yes.

    This allows for the master repo to be clean and you can spin up numerous branch’s in the fork that won’t conflict with anyone else that may be using that repo later.

    If you do have multiple contributors of he master repo, you just need to
    Pull down from that repo regularly to prevent merge conflicts when you merge back into the master repo.
  • 1
    Hum..I never thought about doing this, but, why not multiple branches in one repo? Something like

    Master being the 'never commit to it' branch, a 'dev' branch in which you create your other branches?

    Good question! ++
  • 2
    Why would you do that? I'm not an expert in git by any means, but isn't that what branches are for? And to keep the git flow clean, you can develop in feature branches, merge said branches into e.g. dev and then remove the feature branch completely.
  • 1
    @Condor Exactly what I was asking!
  • 6
    @Condor @phacus
    Forking allows for each developer to do what ever they like to their copy of the repo, without affecting the “master” repos history and running up 100’s of branches for “experiment/xyz”

    Going with a flow that has a dev/master branch + feature / experimentals means the forked repo can be a messy hunk of crap but not ruin the main repo.

    Once the dev has finished what ever they are doing they pull down from the master repo, merge into the forks dev branch for conflict resolution, and then into the master branch - for sandboxed testing, which can then be ran up to the masters dev branch.

    This lets you catch merge conflicts early, do what ever you want without affecting the main repo, or contributors And control what does go up for others to have access to when working with a team.
  • 3
    @C0D4 Thanks for the explanation and, yes, it makes sense. But what if OP is the only mantainer?
  • 6
    @phacus it’s probably overkill unless he’s planning on sharing that repo.
  • 2
    @C0D4 @phacus yeah, it's a team repo. Probably should've specified that.
  • 2
    But there are things like local branches? So it wont clutter the repo with branches as experiment/xyz etc.

    Just don't push the commits you make.

    But if you work on multiple devices feel free to fork it
  • 1
    @Parzi Oh, yeah..It makes perfect sense, then!
Add Comment