How to run an Armory forked repository?

I am very beginner to git and this question may sound stupid, but i can’t run an Armory forked repository to make tests.

Steps i do:

  1. Fork Armory repository.
  2. Clone it locally - can’t run as add-on.
  3. Download the repository as .zip - can’t run as add-on.

Armory3d/armory is just one of the many repositories needed for ArmorySDK to work. It also needs iron, zui and other repositories as well.

To get all repositories with a single clone, use armsdk repository. This repository must be cloned with --recursive option. Even then not all repositories cloned may be up to date. You will have to manually update submodules.

2 Likes

I completely forgot about the dependencies. Thanks for the help!

Just to make sure, do you know if there is some way to share the dependencies of the forked armory3d/armory repository with Armory official git version?

I this case i would clone the armory3d/armory repository and it would use the dependencies from the git version of Armory, being able to run.

Thanks in advance!

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:

  1. Clone the armsdk repo (no need to fork it unless you also want to make changes to this)
  2. Fork Armory
  3. Open the Armory submodule (in a terminal or a GUI client)
  4. 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 (master and 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 :slight_smile: ).

In my GUI client (also called Fork), it looks like this:
armory_remotes

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.

4 Likes

This looks really complicated to undestand because i don’t know too much about the git operations yet, but your explanation was very clear and detailed. Of course this will help me a lot soon. Thanks!