PyBox / Blog / How to

Git on Android: commit and push from your phone

Version control belongs in your editor. PyBox puts Git in the tool rail next to your files.

Git on Android: commit and push from your phone: the PyBox screen this guide uses
PyBox is the Python IDE I build. Everything below works with it, and the steps are the same ideas you would use anywhere. Get it on Google Play.

Start a repository

Open a project and tap the Changes panel. If the project is not a repository yet, tap Initialize repository. To start from GitHub instead, choose GitHub on the home screen and clone a repository by URL.

Commit

  1. Open Changes. Your edits appear as unstaged files.
  2. Stage the files you want, or stage all.
  3. Write a commit message and tap Commit, or Commit & Push.

You can amend the last commit, and open a full diff of any file.

Branches, tags and history

The Branches panel lists local and remote branches and tags. Create a branch, switch, or tag a commit. The History panel shows each commit with author and date. Open a commit's menu for cherry-pick, revert, reset (soft, mixed or hard), a new branch or tag, or a detached checkout.

Push to GitHub

Sign in to GitHub in Settings. Then Create a GitHub repository from a project makes a new repo (private if you choose) and pushes it.

Conflicts

When a merge conflicts, the Changes panel shows a Conflicts section. Edit each file, mark it resolved, and commit. Abort merge puts everything back.

A habit worth building

Commit small, commit often, push at the end of every session. On a phone, that also protects your work.

Questions

Can I push to GitHub from Android?

Yes. Sign in to GitHub in Settings, then commit and push from the Changes panel, or create a GitHub repository from a project.

Can I resolve merge conflicts on a phone?

Yes. Conflicted files are listed, you edit them and mark each resolved, and you can abort a merge if you change your mind.

Anshuman MishraBuilds PyBox at Vytros, a Python IDE for Android. About the developer.

Code Python on your phone.