Preview branch movement before pulling or pushing. These commands intentionally
match the core Mercurial incoming and outgoing semantics while using Git
branches in place of Mercurial bookmarks:
git incomingandgit inshow commits reachable from the comparison ref and not reachable fromHEAD.git outgoingandgit outshow commits reachable fromHEADand not reachable from the comparison ref.
When no ref is provided, the comparison ref is the current branch's configured
upstream, such as origin/feature/foo. If no upstream is configured, the
command exits with code 2 and explains how to set an upstream or pass a ref.
# Fetch the upstream remote and show commits that would be pulled
git incoming
git in
# Fetch the upstream remote and show commits that would be pushed
git outgoing
git out
Pass an explicit ref to compare against something other than the current branch's upstream:
git incoming origin/main
git outgoing origin/release/1.2
By default, remote-backed comparison refs are fetched before comparison. Use
--no-fetch to compare against the currently known local tracking ref without
contacting the remote:
git incoming --no-fetch
git outgoing origin/main --no-fetch
Return codes 0 and 1 follow Mercurial's documented behaviour for these
commands, while 2 is git-donkey's own code for a command that could not run:
0means matching incoming or outgoing commits were found and printed.1means no matching commits were found.2means the command could not run, such as when no upstream is configured and no explicit ref was provided, a configured upstream cannot be resolved, or when the fetch or comparison failed, so automation never mistakes a fetch failure for "no changes".