Yes, that’s totally possible, my local setup does that.
Git submodules are basically just nested repositories and repositories can have different remotes (= connected repositories from Github for example). So you can replace the Armory submodule in the armsdk repo with your own fork, or just use both the armory version and your fork as remotes.
If that was a bit too fast, here is a small example:
- Clone the armsdk repo (no need to fork it unless you also want to make changes to this)
- Fork Armory
- Open the Armory submodule (in a terminal or a GUI client)
- Add your fork as another git remote (I don’t know the command because I’m using a GUI git client, probably
git remote add <url> or something like that)
You then have the possibility to choose from two different repositories when you’re pushing changes. Actually, branches can also track a remote branch (
origin/master for example,
origin is the default name for the “first” remote). It makes sense to let your local branches track the branches of your fork remote, so that you automatically push and pull from the right remote (otherwise you’ll get permission errors unless your name is Lubos ).
In my GUI client (also called Fork), it looks like this:
Under Branches you can see the local branches, and under Remotes you see the connected remote repositories. Origin is my fork and upstream the Armory3D repo, but you can call it as you want.
This approach has one tricky side-effect: you can’t track two remotes with one local branch, so to update my fork I have to rebase the current branch to the commit of the upstream/armory repo and then push all the changes:
In this image, you can see that both
master (local) and
origin/master (the master branch of my armsdk fork) point to a old commit,
upstream/master (armory official) is ahead. Then I rebase
master to the commit
upstream/master points to and push the changes so that
origin/master is also rebased.
Also, you can see that some submodules in the lower left corner have a asterisk (*) behind their names. Those are all changed submodules that are checked out in another commit as the SDK “wants” or they have local, unstaged changes. Submodules also follow the currently checked out commit (better said: the commit to which they should be checked out changes but the submodule itself keeps unchanged) and you then need to manually update them (it’s easy in Fork, just right click on a submodule with a “*” and click on update).
Maybe that helps you a bit, it’s a lot and it’s complicated but it has the advantage that I can keep track of everything, don’t need to re-fork everytime I want to change something and if I want to change another submodule which I haven’t forked yet, I can just do that and add another remote without needing to create a new dev setup first.