Synchronization how to use?

Please tell me how you work and how to add Synchronization. Defold throws an error. I have Git installed


Screen1

You need to first create a Git repository, then copy your project files to that location. Once that’s done the synchronization should work.

You can create a Git repository by running git init in an empty folder:

https://git-scm.com/docs/git-init

2 Likes

Thanks!


How to fix?

Whenever I get this error, I just try synchronizing again and it usually works. You can also try restarting the editor.

Unfortunately, this does not help:(

Are you able to pull/push your code using other source version control software like Github Desktop, Sourcetree, SmartGit…?


What?

What do you mean?

Just to ensure you had setup git correctly for your project. If you are sure so I have no ideas :slight_smile:

1 Like

It seems you had setup it correctly. Sr I’m not using Defold version control tool so can’t help. Somebody here will help you with that clear information from your clips

:frowning:

I think the problem is that you are using a local git repository with no remote set (for instance GitHub or GitLab). I’m sorry if I mislead you about how to set up a local repository. You probably need to actually set up a remote repository, as described here:

I just ran into the same problem, the solution is indeed to set up a remote and also to push a commit to it. Just setting up the remote alone is not enough if there are no commits, it seems.

If you haven’t made any commits yet, you can do that with the following commands:

git add .
git commit -m "Initial commit"

After that’s created, you need a new GitHub repository, which you can create on GitHub. Then you add that repository as a remote through the command line:

git remote add origin https://github.com/<your username>/<your repository name>.git

And push to that repository (assuming a fresh project with default settings):

git push -u origin master

After doing this with a fresh project, I can synchronize just fine.

GitHub also provides instructions when you create a new repository there in case you’re still stuck, and there are git clients like GitHub Desktop that can streamline this process.

2 Likes