Working with git on a phone
Branches, merging with conflicts, history and your own commit — and why there is no push or rebase.
Git on a phone is not a second terminal. It is the handful of operations you need when you are away from the computer — look at what the Agent wrote, switch a branch, merge, write a commit with your own hand. The rest stays on the computer, where you have the tools for it.
A working directory that is not under version control says so right away. It is not an error — there is just nothing to show.
Branches
The list of branches with the active one first. For each you see by how many commits it is ahead and behind the main branch — so you can tell which one is in progress and which one was forgotten, without having to open it.
Tapping a branch switches to it. The app asks first, because the working directory on the Server switches and the mirror of Documents is brought in line — that is a change you do not want to make by accident while the Agent is working.
When there is work in progress in the working directory, the switch does not go through and the app lists exactly what is in the way. The list of files is there deliberately: without it you would not know what to tidy up.
Merging
“Merge into the active branch” gives the work to the Agent, not to git. That is deliberate: a merge can call for a decision the Server cannot make, and the Agent at least knows how to ask.
The Prompt does not go into the Conversation you are working in — you went to switch a branch, not to write about it. It gets a Conversation of its own and you stay on the Git screen; that it is merged shows itself by the history changing.
The Agent does not resolve conflicts on its own. The task that goes out tells it explicitly to list them and wait for instructions. Three ways onward:
- Decide from the phone
- In that conversation you tell it how to resolve the conflict. For the two or three places where you know which side is right, this is the fastest way.
- Leave it for the computer
- You leave the merge in progress and resolve it at the computer. Nothing breaks — the repository is in the ordinary state of a merge in progress.
- Abort the merge
- The repository returns to the state before the merge. Whatever was already resolved in the conflict is thrown away — that is why the app asks.
History and commit detail
The history of the active branch, author, time, message. Tapping opens the detail: the list of changed files and, for each, whether it was added, changed, removed or renamed.
For a commit where the tests ran, their result is right in the detail. That is the place where you find out whether the Agent's work broke something — before you let it go any further.
A commit that changes thousands of files — a formatting pass, a renamed directory — is not sent to the phone in full. The app says how many changes did not fit.
Your own commit
“Write a commit” is the commit you write, not the Agent. You write the message and either commit everything in progress, or tick only some of the files.
The author is signed by git on the computer, not by the phone. When the configuration has no user.name, git refuses the commit and its explanation arrives on the phone — inventing an identity for you would be worse than an error.
Picking files makes sense when the Agent did more than you wanted. You commit the part that is finished and leave the rest in progress.
Typical situations
- I gave it work and I am going to bed
- In the morning the history shows what the Agent wrote and the detail of each commit shows how. When it did not work out, you come back to it at the computer — but you know it before you sit down at it.
- I want to work on a different branch
- You switch the branch from the phone. The Server switches the working directory, the mirror is brought in line and from the next Prompt the Agent works there.
- The work is done and I want it in the main branch
- You switch to the main branch and merge the one in progress. Any conflicts you get listed, not resolved for you.
- The Agent made changes but did not commit them
- You commit them yourself — all of them, or only the files you want. The rest stays in progress.
What is not on the phone, and why
There is no push, pull, rebase, branch creation or reverting of commits. Every one of those can overwrite something that is harder to get back than it is easy to start on a phone — and none of them is the reason a person glances at their mobile during the day. When you need them, ask the Agent in the Conversation; that is a deliberate task, not a tap.
Stuck somewhere other than what is here? Write to support@coden-app.com.