Cubis Engineers

Collaboration

Update branches, resolve conflicts, and prepare work for review without rewriting shared history.

Developer workflowIntermediateUpdated Aug 13, 2026gitcollaborationrebasepull-request

Treat a published branch as shared. Fetch before making integration decisions, and avoid rewriting commits that another person may already use.

Update your view of the remote

git fetch downloads remote branches without changing your files or current branch.

Terminal
git fetch --prune origin
git status --short --branch
git log --oneline --left-right HEAD...origin/main

--prune removes local references to remote branches that no longer exist. It does not delete your local branches.

Rebase a private feature branch

Rebasing replays your commits on a new base and gives them new commit IDs. Use it for your own feature branch; do not rebase a shared branch unless the team has agreed to it.

Terminal
git switch feat/health-check
git rebase origin/main

When Git stops on a conflict:

Terminal
git status
# edit the files and remove conflict markers
git add path/to/resolved-file
git rebase --continue

Use git rebase --abort to return the branch to its state before the rebase. After rewriting a branch you previously pushed, use git push --force-with-lease; the lease refuses to overwrite remote work you have not fetched.

Terminal
git push --force-with-lease

Merge when history is shared

Merging preserves the existing commits and adds a merge commit when a fast-forward is not possible.

Terminal
git switch main
git pull --ff-only
git merge --no-ff feat/health-check

Most teams merge through a reviewed pull request instead of merging into main locally. Follow the repository’s branch protection and review rules.

Resolve a merge conflict

First identify the operation Git is waiting for and the files that need attention.

Terminal
git status
git diff --name-only --diff-filter=U

Edit each file so it contains the intended final result, run the relevant tests, then stage it. Finish with git merge --continue or git rebase --continue, depending on the operation shown by git status.

Tag a release

An annotated tag records a named release point with author and message metadata.

Terminal
git tag -a v1.4.0 -m "Release v1.4.0"
git show v1.4.0
git push origin v1.4.0

Create the tag from the exact reviewed commit that was deployed. A tag is a reference, not proof that an artifact reached production.

References

On this page