# HOWTO: Alternative project hosting

**URL:** <https://forum.defold.com/t/howto-alternative-project-hosting/1309>\
**Category:** The Defoldmine\
**Created:** [March 24, 2016, 6:48pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309 "2016-03-24T18:48:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sven](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sven/32/1086_2.png) [@sven](https://forum.defold.com/u/sven)\
**Post date:** [March 24, 2016, 6:48pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/1 "2016-03-24T18:48:19Z")

</div>

# Alternative project hosting

We use [Git](https://git-scm.com/) for version control of all our projects. Git is a distributed version control system, which means that you can host your game code on any other Git server than the one provided by our service. We are working on a way to enable this through the editor, but it’s still possible to do with just a little bit of fiddling on your own.

Currently you still need to create a project on our dashboard just so the editor knows a project exist.

**Please note this should be considered an advanced feature, use with care!** 🙂

## How to use a custom Git server

What we need to do is change the projects _origin_ URL. This can be done in most graphical Git clients, such as [SourceTree](https://www.sourcetreeapp.com/) and [GitHub Desktop](https://desktop.github.com/).

### Graphical clients

1. Open your project in the Defold editor.
2. Right click on the `game.project` file, select “`Show in Finder`” (or similar for your platform).
3. Add this folder to your client as a local repository, then:  
**SourceTree** - Repository settings; ![](https://forum-defold-uploads.b-cdn.net/original/1X/e60934a77d8961e9bd9ca4732891da38a3a8dc0b.png)  
**GitHub Desktop** - Repository settings; ![](https://forum-defold-uploads.b-cdn.net/original/1X/6ff4b1a642ab51a81be709f0de5b4cb02dfa8633.png)

### Command line

Prerequisite: Git - [OS X](https://git-scm.com/download/mac), [Windows](https://git-scm.com/download/win), [Linux](https://git-scm.com/download/linux)

1. Open your project in the Defold editor.
2. Right click on the `game.project` file, select “`Show in Finder`” (or similar for your platform).
3. Next, you need to navigate to the project location (from step 2) in a terminal window. Here’s how:
  - **OS X** - Open the project location in `Terminal.app`, for a detailed guide see [this](http://lifehacker.com/launch-an-os-x-terminal-window-from-a-specific-folder-1466745514).
  - **Windows** - Open the project location in `Git Bash`, for a detailed guide see [this](http://lifehacker.com/5382503/quickly-copy-file-paths-to-your-command-prompt-via-drag-and-drop).

4. Lastly, change the ​_origin remote_ to your own Git URL entering these commands into your terminal:

```lua
git remote set-url origin <your_own_git_server_url>
git push -u origin master

```

The Git server URL can either be your own private server, or one from a third party provider/host, see below.

## How to get your Git server URL

### GitHub

1. Create a new repository
2. Your Git URL can be found here:  
 ![](https://forum-defold-uploads.b-cdn.net/original/1X/6f122558367bf9bfea933b752cc0262f69c63dfa.png)

### BitBucket

1. Create a new repository
2. Your Git URL can be found here:  
 ![](https://forum-defold-uploads.b-cdn.net/original/1X/56ac76f7516e35551c4336ac37549cfba0f97ba2.png)

### GitLab

1. Create a new project
2. Your Git URL can be found here:  
 ![](https://forum-defold-uploads.b-cdn.net/original/1X/cea760ec3d562b0ad02155347f06c5c326f3b20b.png)

---

<div class="post-metadata">

**Author:** ![jack0088](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jack0088/32/1702_2.png) [@jack0088](https://forum.defold.com/u/jack0088)\
**Post date:** [August 1, 2016, 12:28pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/2 "2016-08-01T12:28:13Z")

</div>

I fallowed this tutorial. I also needed to generate ssh token, to get through the authentication issue I had (permission denied) Now I got it working with GitHub Desktop Client, **but** I can not open the project inside the defold IDE anymore. Since I changed the _head_ of the git repo and its url, I think defold can not read it anymore?

1. Is this expected behavior? If so, how can I open projects that are synched to GitHub instead of defold?
2. Could I push commits to both repositories (defold and github)?

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/0/0dac72b3d1c58fef124c9802149d2eee8f4d1efa.png)

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [August 1, 2016, 12:33pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/3 "2016-08-01T12:33:27Z")

</div>

> [@jack0088](#):
>
> GitHub Desktop Client

Going to guess that this app is what is at fault with messing with metadata. Retry with something like SourceTree, I have got it to work with this before. Also, consider switching to Bitbucket. I find it superior to private projects personally.

---

<div class="post-metadata">

**Author:** ![jack0088](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jack0088/32/1702_2.png) [@jack0088](https://forum.defold.com/u/jack0088)\
**Post date:** [August 1, 2016, 1:13pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/4 "2016-08-01T13:13:15Z")

</div>

I removed my repo from /applications/defold/branches/…  
But I think I messed up the login token by generation a new one inside the defold project panel.  
Now I always get the error from screenshot above! I can not download it anymore from defold repo.  
Any way to revert this?

\Edit: I can actually not pull any of my projects. Maybe because I generated a new git _ssh key_ and somehow overriden the old one (containing the defold ssh key)?

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/5/5fb503a33a3dc1ca19df8b536fcc008959e28eab.png)

---

<div class="post-metadata">

**Author:** ![jakob.pogulis](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jakob.pogulis/32/557_2.png) [@jakob.pogulis](https://forum.defold.com/u/jakob.pogulis)\
**Post date:** [August 1, 2016, 1:23pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/5 "2016-08-01T13:23:43Z")

</div>

As @sven mentions in the original post, this is an advanced configuration (not really a feature even), that should be used with care. There is process or functionality in place to reset a repository to it’s original state.

---

<div class="post-metadata">

**Author:** ![sven](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sven/32/1086_2.png) [@sven](https://forum.defold.com/u/sven)\
**Post date:** [August 1, 2016, 1:27pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/6 "2016-08-01T13:27:43Z")

</div>

Could you try signing out in the editor, then signing back in again? Then try to open up the project and create a new branch.

I would recommend using an external git tool for handling more advances repository stuff like this. 👍

---

<div class="post-metadata">

**Author:** ![jack0088](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jack0088/32/1702_2.png) [@jack0088](https://forum.defold.com/u/jack0088)\
**Post date:** [August 1, 2016, 1:31pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/7 "2016-08-01T13:31:06Z")

</div>

I tried with signing out and in and it worked! Now I can download my projects again! Thank you @sven  
I’m not very expirienced with command-line git! But I can handle visual tool like GitHub Desktop App. And I really like that I can commit only what I want, insted of having defold staging and pushing everything! (And after that push I can not revert specific files…) So I need to get this working!

  
\*\*# Edit:\*\* ok, here's what I found out... If you want to push commits manually to defold's repo (dashboard), you are out of luck with the \*GitHub Desktop Client\*! As soon as you change the origin remote url, the defold IDE can't relate to it anymore. On the other hand you can't push through the GitHub Client to remote repos \*other than\* the ones at github.com. So basically you break everything.

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/2/27e8afd597e0549077ae792e02558fbdbb3b0086.png)

Changing this will break the link between Defold IDE and the online repository.

  
What you want do instead is using \*SourceTree\*, as @sven advised. Just drop your local branch (git repo) into it.

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/3/373e17e51fb8b5dc53e16a004ce1181f3789e678.png) 

Open your repo (double click) and now you can see all previous commits. Now you can normally work with defold IDE and every time you need to save a progress step (commit) you go into SourceTree and make a commit. _This is also the place where you can decide which file changes to include into a commit and which not (staging)._ When you push commits to Defold’s repository (dashboard), SourceTree will prompt you to type in your login. Use your eMail as username and your access token as password. Sometimes you have to type the password multiple times (once per git operation).

Additionally, if you want to maintain a separate copy of your repo, you might add an additional remote server (such as bitbucket). **Don’t mess with the `origin` name here, if you are not experienced!** This might mess up connection between defold and its repo again! Just add a second repo. Now you can push to both at will.

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/2/2ffb55cad6e5e9f70a5df6d0ae8a52e9f2324440.png)

 ![](https://forum-defold-uploads.b-cdn.net/original/2X/5/5f5657aed875609e41556498e30ed0a6312ad07e.png)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [August 1, 2016, 8:13pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/8 "2016-08-01T20:13:32Z")

</div>

Side-note: The latest and greatest in terms of Git clients seems to be [Git Kraken](https://www.gitkraken.com/). I haven’t made the switch from GitHub for Desktop yet, but I’ve heard a lot of good things about Git Kraken and from it’s list of features it sounds like a really nice tool.

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [August 1, 2016, 8:40pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/9 "2016-08-01T20:40:25Z")

</div>

Just tried GitKraken out. Seems really nice, clean, and fast! Love that it has built in integration with Bitbucket and Github! Instantly liking it more than SourceTree.

---

<div class="post-metadata">

**Author:** ![Oleg\_The\_Evangelist](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/oleg_the_evangelist/32/1596_2.png) [@Oleg\_The\_Evangelist](https://forum.defold.com/u/Oleg_The_Evangelist)\
**Post date:** [June 22, 2017, 12:16pm UTC](https://forum.defold.com/t/howto-alternative-project-hosting/1309/10 "2017-06-22T12:16:33Z")

</div>

5 posts were split to a new topic: [Looks like a regression: custom git client error 500](https://forum.defold.com/t/looks-like-a-regression-custom-git-client-error-500/9342)
