Is it possible to use git on mobile?

4.4

Hi i heard that git saves your game as versions, So you could keep old games and also go through the updates in your games, But is it possible to do this on mobile? I see them doing it on PC or laptop, I hope it’s possible to use git on mobile! If it is possible then can you explain how to start git and etc? Because since you can’t log in an account in Godot, then i would have to use git. I’m a mobile game developer so i really want to know this.

Thanks.

There’s a section exactly about this in the documentation, see:

1 Like

So do i just install termux terminal then add a line of code in my godot game to connect termux terminal to my godot game? I’m very new to this so i’m not sure on what i’m supposed to do

git and other revision control systems will keep snapshots of your project, but it’s usually a manual process. The snapshots are usually called “versions”. “commits” or “revisions”, and are generally what the files in your project looked like when you asked it to “commit”.

You probably want to read a proper git tutorial (there are plenty online), but revision control systems are very useful for software development:

  • they track changes, so if you commit working code regularly and something breaks, it’s easier to find what/where it broke
  • they often provide ways of syncing between machines, so you can use it to make backups on other systems, and collaborate with others
  • once you’ve shipped, they can help you answer questions like “was this feature in the March release?”
  • &c. &c. &c…

Following the instructions from @tibaverus 's link will get git on your device, but you’ll also want to understand what git is and how to use it. It’s worth the time investment.

1 Like

“Shipped?” Is it not free ?

I think they mean when you ship your game.

1 Like

Yes, as @paintsimmon says, I meant “shipped” in the sense of: Once you’ve built your game and have started letting other people use it.

It doesn’t matter as much if it’s a “for fun” project, but if you’re planning on getting a game out there and asking for money for it, maintaining the game (fixing bugs, possibly adding features, maybe adding translations so you can sell in other countries…) is a whole thing.

Once you have paying customers it’s very easy to wind up rushing a few bug fix/feature releases out and then realize later that you really aren’t sure what got released when. If you can go back to the git logs and see your commit notes (or at worst, the diffs), you’ll have a much easier time reconstructing what each version you released changes.

1 Like

Hi! Uh i realized that there’s a “git” thing every time i make a godot project! Meaning it’s able to go to git hub right? And i also realized there’s an app called github in playstore! Looks like a cat, is that the real github app?

“github” (despite the name) is just a 3rd party service built on top of git. Actual git is a command line tool that’s free software (in both the “freedom” and “beer” senses), and you can use it without github or gitlab or gitea or any of the other “forges” people have built on top.

If you’re just using git yourself or in a small group, github can get in the way as much as it helps; as long as all the machines that need dev copies of your game repo can see each other over ssh (secure shell), you can use git to do distributed development without a forge.

The forges (github, gitlab, gitea…) add features like issue tracking and pull requests that you might want, and can make things conceptually slightly easier for you if you aren’t used to the idea of distributed revision control without a single source of truth centralized server. They also come with costs; with the business-run forges like github (which is a Microsoft subsidiary now…) you have regular pressure to move up to paid tiers, along with the fair certainty that in the background they’re training AI off your work without compensation. Like any SaS thing, they also have the usual papercuts; UI churn, lack of control over upgrades and changes, all that.

You can get away from that by running your own copy in your own server (gitea works this way, I think you can do this with gitlab too), but then someone on your project is accepting at least lightweight sysadmin duties. You’ll also almost certainly need a server running docker somewhere.

git works just fine on its own; I’m doing godot dev here on a couple of linux boxes, a windows machine, and a NAS. The NAS is just a linux box. I created the repo on the NAS as a bare repo through a secure shell connection using git init. On the other machines, I use git clone to get a new copy of the repo, git status to see what’s changed, git pull to pull in changes, git add, git commit and git push to push them out.

I use the NAS because it’s convenient and always on, but I could push/pull directly between my dev machines, or even between different copies of the repo on the same machine.

You can totally use github if that’s what works for you, but you can also use git without it.

1 Like


What are these two then? Am i using git without github already if i do this? Im gonna press accept but i still wanna know what it means

If you aren’t already using git then that should set it up. Personally, I always use the command line tools to do it, but whatever you’re comfortable with.

What that should do is create a .git folder in the root of your project. That’s where git keeps most of its internal data. Once that’s created, git uses that to handle your project.

git is file-based; any files you tell it about with git add, it will track. I presume the Godot IDE automates this, but I haven’t tried using that part of it.

1 Like

The Godot IDE doesn’t do anything to add files to git. You need to install a git plugin for that.

1 Like

I sense a lot of confusion about what git even is. From your question it sounds like you want to use it somehow in the game itself (that is, in the finished product that you ship to people).

That’s not what git is for and it will work poorly if at all.

Git is a tool for developers. It’s something you use while developing your game. With it you can make snapshots (“commits” in git terminology) of your project files as you work on them. And then it adds a lot of neat features on top of that. Features such as:

  • You can always go back to any previous commit no matter how old
  • You can easily find when any line code was written and by whom (and if you bothered to add meaningful comments to your commits - also why)
  • Multiple people can work on the same files and easily synchronize their work (“merge” in git terminology) without losing anything
  • You can back up all your commits to a remote server with a single click.
  • You can see what you’ve changed since your last commit
  • Etc.

Git is an awesome tool for software development and most professional software developers, including me, always use it even if they work solo. Keeping track of everything you’ve done is incredibly useful. And it especially shines in larger projects with multiple developers, where work without it would be practically impossible (or at least magnitudes more difficult).

However I haven’t heard of anyone shipping it as a part of a game. I can’t imagine it being useful on the end user’s device.

2 Likes

Oh well, That’s the whole reason why i want git, i can go to an older version of my game if i accidentally destroyed something, because i want to delete the unnescesary files and scripts and scenes, so i wanna use git to go to an older version just in case i destroyed something, and i am not shipping my game, and my game isn’t finished yet.

How to add a git plugin? I thought just creating a vcs git will work?

Oh, in that case, yes - this is EXACTLY why git was created. :slightly_smiling_face:

Now, using git is not tied to Godot. Godot doesn’t really need to know about git and you don’t need any plugins to use it. The plugins will just add some options for using git from within the Godot editor - but that’s just for convenience and is not necessary.

I suggest finding some git tutorial and familiarize yourself with git. There is a bit of a learning curve.

If you work on Windows, I can also recommend TortoiseGIT (that’s a GUI built on top of git which makes using it easier).

1 Like

Oh cool! I made a github account and im making a repository and im wondering on what this “.gitignore” thing is? Its telling me to use a template but there are SO many templates to choose from, should i use the Android template? Im on Android so yeah, i searched some tutorials but none of them told me what template to use, the rest i already know i think because of videos.

Again - I highly recommend doing a tutorial first.

.gitignore is a feature that allows you to skip files. That is, usually you want your source files to be in git, but you don’t want build results or temporary files, etc. There’s always some files that have to be in your project folder, but which don’t make sense to put in git.

Before every commit you get to choose which changes you want to include in that commit (each commit is a full snapshot of your project folder, but you get to choose which changes since the previous commit you wish to include in the next one). Git itself shows you a list of new and changed files that you can choose from.

.gitignore file lists the files and folders that you DON’T want git to offer you. It will skip them and not offer them in its list of changes. Note that this is purely cosmetic - you can still manually tell git to include whichever file you want. It just cuts down on the noise when you ask git to show the uncommitted changes.

You don’t need this file initially and you can build it up as you go, when you identify the files/folders you don’t want in git. There are also probably godot-specific templates you can use as a starting point.

The .gitignore file itself is usually stored in the repository (but that’s not mandatory either).

1 Like

i’ve done a lot of researching and learned more about git and github but the thing is… mobile is limited, in the github mobile there’s nothing to do there, in the github website i can make repositories but i cant add a local path to them, because there’s no local path thing there, so i might not even use github at all, and the git website is confusing, i’m trying to download it but it’s not letting me, is even possible to use git on mobile? I need the real git to use the git plugin if i remember correctly.

So, wait… You’re actually developing the game on, like, an Android tablet?

1 Like