﻿---
title: Git for Android
date: 2024-03-08
excerpt: Use MGit as a Git client on Android, including installation, cloning, local repositories, URL formats, and SSH key setup.
tags:
  - Git
  - Android
  - GitHub
cover: https://assets.vluv.space/cover/ToolChain/gitForAndroid.webp
updated: 2026-07-08 07:21:51
lang: en
i18n:
  cn: /GitForAndroid
  translation: 2
---

## Download

1. Search for `Mgit` in F-Droid, then download and install it. It is also available in the Play Store, but some features do not work properly there.
2. Choose a suitable release from the [GitHub](https://github.com/maks/MGit) repository.

## Quick Start

### Clone a remote repository

- Click on the `+` icon to add a new repository
- Enter remote URL [see URL format below](#url-format)
- Enter local repository name - note that this is not the full path, as MGit stores all repositories in the same local directory (can be changed in MGit settings)
- Click the Clone button
- If required, you will be prompted for credentials to connect to the remote repo. MGit will download the repository (all branches) to your device

### Create a local repository

- Click on the + icon to add a new repository
- Click on Init Local to create a local repository
- Enter the name for this repository when prompted
- A local empty repo will be created

### URL format

**SSH URLs**
SSH running on standard port (22): `ssh://username@server_name/path/to/repo`
SSH running on non-standard port: `ssh://username@server_name:port/path/to/repo`
username is needed - by default, MGit tries to connect as root.
**HTTP(S) URLs**
HTTP(S) URL: `https://server_name/path/to/repo`

### SSH

**MGit App**
`Settings -> SSH Keys -> + icon -> input NewFileName -> Generate Key -> Open File and Copy the content`
**GitHub**
[Settings/keys](https://github.com/settings/keys)
New SSH Key -> input Title -> Paste the content
