Skip to content

UserManual

Maksim Lin edited this page Sep 24, 2024 · 5 revisions

MGit User Manual

Introduction

If you are new to using Git, you should read a tutorial or the first few chapters of the excellent Pro Git book

Getting Started

Good starting order is:

Cloning a repo

By default your local repo will be stored within: /storage/sdcard/Android/data/com.manichord.mgit/files/repo

though this locations can be changed in MGit's Settings.

Importing a local repo

MGit If you have an existing repo on your devices storage, you can import it into MGit. You have 2 options when you do this, you can either import it "as an external repo" or not. Choosing to "import as external repo" will simply add an entry within MGit's internal database pointing to the location of the existing repo. Leaving the "Import as external repo" box unticked will have MGit COPY the repo from it's existing location to the default location where MGit creates repos when it clones from a remote repo. This location is configurable in MGits settings screen. You are also able to change the name the repo will have when it is copied to this new location.

Branches and Tags

Browsing Files and Commits

Diffs

Editing Files

Searching

Staging a Commit

Fetching, Pushing and Pulling

Merging

Rebasing

Cherry-picking

Add a Remote for Repo

Settings

Identifying yourself to Git

You need to set your name and email in the MGit's settings as git needs these to fill in the correct metadata whenever you create a new commit in your local repo.

Authentication

MGit support authenticating to Git remotes via HTTPS and SSH protocols. For HTTPS username/password is used, while with SSH both username/password or private key authentication is supported. As of MGit 1.5.2, password protected private keys are supported.

HTTPS

SSH

Password Authentication

The username is usually supplied as the first part git remote url, eg. [email protected]:maks/MGit while the password can be entered in the password field in the "Clone Repo" dialog.

NOTE: GitHub no longer supports using username+password, instead to use MGit with GitHub you can either use SSH or use a personal auth token.

Private Key Authentication

If you have a public/private key and you have setup your public key then you can add your SSH private keys via MGits Settings.

In the Manage Private Keys screen, you can create a new public/private key pair ("plus sign" icon) or import an existing private key ("down arrow" icon) from a location on your Android devices file-system.

For private keys which are protected by a password, once the private key has been added to MGit, the password can be provided by long-pressing on the private key file and then using the "Edit key password" action menu item.