Branches, merges and remotes in ddugit
Branches, tags, merges and rebases happen on the map, mostly by dragging. Fetch, pull and push tell you what will move before it moves, and when a branch has diverged, ddugit asks how to combine the two sides.
Updated
Create a branch
- Click + next to Branches in the sidebar, choose New branch… in the top bar's branch switcher, or press ⌘/Ctrl + Shift + B. The branch starts where HEAD is.
- Right-click any commit or branch and choose New branch here… to start it somewhere else.
- In the commit panel, tick Commit on a new branch to create one as you commit.
Type a name and click Create and switch. The new branch is checked out right away.
Switch branches
Double-click a branch in the sidebar, right-click it and choose Check out, or pick it from the branch switcher: the current branch's name at the left of the top bar. The switcher lists local branches first, then remote branches that have no local branch yet. If the branch is checked out in another worktree, ddugit opens that worktree in a tab instead, since Git can't check out one branch in two places.
Remote branches
Double-click a remote branch, or click the + on its row, to create a local branch that tracks it. Its menu has the same thing as Check out as local branch, plus Check out under another name…. When a local branch with that name already exists and points somewhere else (say upstream/main next to your own main), ddugit doesn't switch to yours silently. It asks for a new name for the tracking branch.
Tags and single commits (detached HEAD)
A tag's Check out and a commit's Check out this commit (detached)… put you on that commit without a branch. ddugit says so before it does it: commits you make there belong to no branch and are hard to find once you check out something else. The top bar then reads Detached HEAD @ and the commit ID. To keep work you did there, use New branch here… on it.
Rename and delete branches
Right-click a branch and choose Rename…. If the branch tracks a branch of the same name on a remote you can push to, the window offers Also rename on origin (or whichever remote it is). ddugit then pushes the new name and deletes the old one there. If one of those steps fails, it tells you which.
Delete branch… removes the local branch only. Branches on remotes aren't affected. If the branch has commits that aren't merged into any other branch, a second window,Unmerged branch, asks again. Delete anyway leaves those commits only in the undo history (see undoing in ddugit). You can't delete the branch you are on. To tidy up many old branches at once, use Clean up branches… in the ⋯ menu next to Branches.
Tags
Right-click a commit or branch and choose Tag here…. Give the tag a name such as v1.0.0. Add a message to make an annotated tag, or leave the message empty for a lightweight one. Tick Push it to origin right away to publish it in the same step.
A tag's menu, on the map or under Tags in the sidebar, has:
- Go to tag and Check out (detached, as above),
- Push to origin, one entry for each remote you can push to. Git refuses the push if that remote already has the tag on a different commit. ddugit never force-pushes tags,
- Delete tag, which deletes only your local tag,
- Delete on origin…, which deletes the tag on that remote for everyone who uses it. Your local tag stays, and clones that already fetched it keep their copy.
To publish every tag at once, open a remote's ⋯ menu in the sidebar and choose Push all tags.
Merge by dragging
Drag a branch tip, or any commit, onto the tip of the branch it should go into. While you drag, the hint reads Release to merge over a valid target. You can also right-click a branch and choose Merge into main… (with the name of your current branch). If the target isn't the branch you have checked out, ddugit checks it out first. To avoid merging by accident, lock the map with L. Dragging then only moves the view.
The Merge window shows which branch goes where. Under How to merge, choose:
- Merge commit: always makes a merge commit, even when a fast-forward would do (
--no-ff). Type a message, or leave it empty for Git's default. - Fast-forward: moves the target branch forward without a merge commit. If the branches have diverged, a fast-forward isn't possible and the window says a merge commit will be made instead.
- Squash: combines all the incoming changes into one and stages them, without committing. The button reads Stage. The commit panel then opens in staged-only mode with a message built from the merged commits, for you to review and commit. A squash needs a clean working tree: commit or stash changes to tracked files first.
ddugit remembers the mode you picked last and offers it first next time.
If the merge stops on conflicts
A banner reads Merge in progress — 2 conflicted files. Click Resolve conflicts to work through them, then commit with + to finish the merge. Cancel puts everything back as it was before the merge, for a squash merge too. The full walkthrough is in resolving merge conflicts.
Rebase onto another branch
To replay your branch's own commits on top of another branch, right-click that branch and choose Rebase feature onto main…. Or hold ⌘/Ctrl and drag your current branch's tip onto the other branch's tip, local or remote. The confirmation says how many commits move and warns you when:
- some of them are merge commits: a rebase leaves merges out and lines the commits up in a row,
- some of them were already pushed: you will need to force push afterwards,
- you have uncommitted changes: they are put aside and restored when the rebase is done.
Every replayed commit gets a new ID. To reorder, squash or drop commits instead, see interactive rebase.
Fetch, pull and push
The top bar has Fetch, Pull and Push, also on ⌘/Ctrl + Shift + F, P and U. The badge on Pull counts the remote commits your branch doesn't have, and the badge on Push counts your commits the remote doesn't have, both as of the last fetch. The name of the remote branch you track appears next to the branch name.
- Fetch downloads new commits from every remote and drops remote branches that were deleted there. Your branches and files stay as they are.
- Pull brings the remote's commits into your branch. It only fast-forwards. If both sides have new commits, ddugit asks how to combine them (see below).
- Push sends your commits. The first push of a new branch creates a branch with the same name on the remote (
origin, or the first remote you can push to) and tracks it.
Confirmation before pull and push
By default, Pull and Push ask first. Pull fetches, then lists the commits that will come in and warns you if uncommitted changes might get in the way. Push lists the commits that will go out and the remote and URL they go to. Tick Don't ask again to skip a window from then on. To turn it back on, or to confirm fetches too, use Confirm before in Settings → Appearance.
When branches have diverged
If you and someone else both added commits, a pull can't fast-forward. The Branches diverged window draws the fork with your commits and the remote's, and offers two ways forward:
- Merge joins both lines of history with a merge commit.
- Rebase replays your commits on top of the remote's, for a linear history. Avoid it for commits you have already shared.
ddugit's rebase pull fetches and then rebases onto the remote branch by name. Plain git pull --rebase can silently drop a local commit that was once on the remote and later overwritten there. ddugit's way keeps every commit of yours whose change the remote doesn't already have. Commits the remote already has are left out, and ddugit tells you how many.
Rejected pushes and force push
If the remote has commits you haven't pulled, Git rejects the push. ddugit fetches and opens Push rejected, with Git's output and three choices: Merge and push, Rebase and push, or Overwrite (force push). Overwrite throws away the remote-only commits, so pick it only when they are yours, for example after you amended or rebased.
You can also force push any local branch from its menu with Force push (overwrite)…. The window says how many commits will drop off the remote branch, as of your last fetch. Every force push from ddugit uses --force-with-lease: if someone pushed after your last fetch, nothing is overwritten and ddugit tells you to fetch and look first.
Upstream branches
A local branch's menu manages the remote branch it follows:
- Track remote branch… lists remote branches, with the one of the same name first. The current one is marked now.
- Stop tracking origin/feature removes the link.
- Push feature pushes that branch without checking it out, and it tracks the pushed branch from then on.
- Fast-forward to origin/feature moves a branch you haven't checked out up to its remote branch. When it can't, the menu says why: Pull the checked-out branch, Diverged, Up to date or Gone on the remote.
A branch without an upstream still works. When you pull or push it and the remote has a branch of the same name, ddugit makes your branch follow that one, so a pull never says “push first” while a push says “pull first”.
Delete a branch on its remote
Right-click the remote branch and choose Delete on origin…. It is deleted for everyone who uses that remote. Your local branches stay. Pull requests from that branch can no longer be merged.
Remotes
Remotes are listed in the sidebar under Remotes, one fold per remote. Click + to Add remote: enter a Name and URL, or pick from your GitHub or GitLab repositories, then click Add and fetch.
Any remote not named origin is added as fetch-only, because it is usually someone else's project, such as the original of your fork. ddugit never pushes there. If a branch tracks a fetch-only remote, the push window explains this and offers Push to origin instead. After that, the branch tracks origin.
A remote's ⋯ menu has Fetch origin only, Copy URL, Push all tags, Make origin fetch-only (block pushes) or Allow pushing to origin, Rename…, Edit URL… (a fetch-only remote stays fetch-only) and Remove remote origin…. Removing a remote deletes its remote-tracking branches from your repository. The remote repository itself and your local branches are not affected.
Sign-in and SSH problems
ddugit runs Git without terminal prompts, so a password or passphrase prompt would never appear. When a remote needs a sign-in, Authentication required opens instead, with steps for your system: a credential helper or Git Credential Manager for HTTPS, or the GitHub CLI. For SSH, it can set things up in the window: Generate key (an ed25519 key without a passphrase), Copy public key to add it to your account, Check server to compare the host key with the fingerprint GitHub or GitLab publishes, then Trust this server and Test. Show Git output has the exact error. Click Retry when you are done.
Pull requests and merge requests
When a remote is on GitHub or GitLab, open pull requests (merge requests on GitLab) appear as badges such as #12 or !12 on their head commits, coloured by the state of their checks. The sidebar's PRs (or MRs) section lists them with their checks, review state (Approved, Changes requested) and Draft mark. Merged and closed ones are folded below. Click one to show it on the map, double-click to open it in your browser, or right-click for Open in browser, Show in graph and Check out its branch.
Connecting GitHub or GitLab
If you are signed in with gh auth login or glab auth login, ddugit uses that token. Otherwise click Connect GitHub (or GitLab) and paste a token that can read and create pull requests. Create a token opens the right page. The token is stored only in your system's keychain, never in ddugit's settings. The key button in the section header lets you replace it, or Remove saved token. For a server other than github.com or gitlab.com, ddugit only uses the CLI's token if the CLI is signed in to that server, and warns you before you paste a token for it.
Create a pull request
Right-click a local branch and choose Create PR…, or click + in the PR section's header for the current branch. Choose From and Into (it starts with the repository's default branch), and Remote if there are several. The Title and Description are filled in from the commits, which are listed below. Tick Create as draft if it isn't ready. If the branch isn't on the remote yet, or has newer commits, the button reads Push and create PR and pushes first. If a pull request is already open for the branch, ddugit links to it instead of making another.
Public repositories on github.com and gitlab.com work in the free version. Private repositories and company servers (GitHub Enterprise, self-managed GitLab) need ddugit Pro for pull request features.
On the command line
Roughly what ddugit runs for you:
git switch -c feature/x # new branch
git switch --track origin/feature/x # remote branch as local
git merge --no-ff feature/x # or --ff, or --squash
git rebase --autostash main
git fetch --all --prune
git pull --ff-only
git push -u origin feature/x # first push
git push --force-with-lease
git branch --set-upstream-to=origin/feature/x
git fetch . origin/feature/x:feature/x # fast-forward without checkout
git push origin --delete feature/x
git tag -a v1.0.0 -m "message" && git push origin v1.0.0