Open local project?

Hi!

Is it possible to open a local project?
My teammates and I are having a hard time with Defold’s git and want to use our own repo.
So is it possible to not use Defold’s collaboration and just use own plain Git?

You can’t use any github or private repo, but you can use any old git client - like for instance I use sourcetree - to work with the existing Defold repo.

Setup

Just point your client to the repo found in Defold/Branches/[number]/[number]/[DefoldBranchName]

From there you can push and pull like usual. Now in order to do that you need to authenticate yourself. Use your e-mail as username. To get the password, log in to the Defold dashboard and click on your user and choose settings. There is an access token. That is your password to the git repo.

In sourcetree I just get a prompt for username and password and I fill in the details there. Other clients might be different.

Note that the DefoldBranchName is the branch name given to you when you cloned the project to your drive. This branch name is not the same as a git branch. This is just some unfortunate naming, which I assume will go away in a future version of Defold.

About putting credentials into the origin url

If you want to put the credentials into the origin url (not recommended, but maybe required for some clients) you need to add the following to the beginning of the url (after http://):

your.name%40gmail.com:accesstoken@

In this case assuming you have a the e-mail address your.name@gmail.com. The important thing is replacing the @ with %40 in your e-mail. And obviously you need to replace accesstoken with your actual accesstoken.

Important when using external git client

Once you start using a client you will notice that if you do synchronize in defold it will always commit to the master branch. And if you are on any other branch and do synchronize it will actually merge what you have into the master branch. So if you are on any other branch than master make sure you do your commits in the client. Also worth noting is that Defold will automatically stage everything. That usually isn’t a problem, but when dealing with merge conflicts you just need to keep an eye out so it doesn’t stage your temporary files created by your merge tool.

About submodules

You can have git submodules in your repo, and it will even work with synchronize. There is just one thing to keep in mind. You can’t do any changes inside Defold to files in your submodule. If you do, or drag a file into that folder inside Defold, it will stage all the files in the submodule and it will cease to be a submodule. But you can do changes to the files in a submodule in a text editor outside Defold (even if Defold is running). So don’t worry about that. Just don’t do it inside Defold.

2 Likes

Thank you very much!!
We pointed a repo to the same folder Defold repo is in and it works, however it would be nice if you just could open your own local folder in Defold :smiley: