Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: December 20, 2024
When working on software projects using Git and GitHub, we often create multiple branches to handle different features, bug fixes, or experiments. Branching allows us to keep our main code clean and stable while we develop changes separately. Among the various naming conventions and workflows used in Git, we might encounter something called a wip branch.
At first glance, the term wip may sound like a Git or GitHub-specific keyword. However, wip is simply short for “work in progress”. It’s not an official Git feature or a special GitHub keyword. Instead, developers use this common naming convention to indicate that the code on that branch is still under development and not ready to be merged or released.
In this tutorial, we’ll explore what a wip branch is, why teams create them, how they fit into a typical GitHub workflow, and best practices for using them effectively. By the end, we’ll understand how a wip branch can make our development process smoother, reduce confusion, and help maintain a clean and stable main codebase.
A wip branch is essentially a regular Git branch that we name in a way that signals its status. The letters wip stand for work in progress, and we often prepend or append these letters to a branch name to indicate that the code on it is incomplete or experimental. This serves as a clear, human-readable indicator that the branch should not be considered stable or final.
For example, we might create a branch called wip-new-feature while still building out that feature. This naming immediately tells anyone looking at the repository that the branch contains code that is not yet polished, tested, or ready for production.
Unlike certain naming patterns that have specific meanings in Git workflows – like main for the primary branch or release for stable code – wip is more about communication. It’s a convention that we adopt to share the status of the code. The Git system itself treats a wip branch the same as any other branch. There are no special permissions or built-in protections because of its name.
Since a wip branch is just a normal branch, we create it using the standard Git commands. For example, if we want to start a new feature and mark it as work in progress:
git checkout main
git pull origin main
git checkout -b wip-new-feature
Now we have a local branch named wip-new-feature. We can work on our code, add commits, and push it to GitHub:
git push -u origin wip-new-feature
Our new branch will appear on the GitHub repository. The wip prefix signals to everyone that the feature is incomplete.
As we progress, we can commit changes, push updates, and request feedback. Others will understand that this branch is a work in progress, so they will not be surprised by partial features or broken tests.
The main benefit of using a wip branch is clarity and organization within our development workflow. Let’s consider the following common situations.
When we start working on a new feature, our code might be incomplete, unstable, or subject to drastic changes. By placing this code on a branch that includes wip in its name, we clearly convey that it is not ready for others to rely on or merge into the main codebase. This prevents confusion if teammates stumble upon the branch and wonder if it is stable.
If multiple developers are working on a project, a wip branch helps signal the status of a branch to everyone. Suppose we push our partial changes to GitHub so we can access them from another machine or get early feedback. Labeling the branch with wip makes it obvious that this code is a draft. Other contributors know they can review it for feedback, but they should not merge it or treat it as finished work.
Sometimes, half-complete code might accidentally merge into our main or production branch, causing instability and bugs. By using a wip branch, we lower the chances that someone will merge the code prematurely. The name acts as a reminder that this branch needs more work before it can be integrated.
In some workflows, we frequently push our local changes to a remote wip branch, even if those changes are not ready. This acts as a backup or a checkpoint. If our local machine fails or we need to switch contexts, we can pull down our wip branch anywhere. As the name clearly indicates, this is not a polished branch, just a storage location for our ongoing work.
A wip branch fits naturally into common GitHub workflows. Here are a few ways we can incorporate them.
GitHub supports draft pull requests, which allow us to open a PR that indicates it is not ready to be merged. Combining the concept of a wip branch with a draft PR gives us a powerful way to signal the status of our work. For instance, we might create a pull request from wip-new-feature into main but mark it as a draft. This leaves no doubt that the code is not final.
With a draft PR, team members can review our work-in-progress code, leave comments, or suggest improvements without merging it. When ready to finalize, we can mark the PR as ready and rename the branch if needed. Some teams might even go step further – and just keep draft pull requests instead of wip branches.
If we have a CI pipeline set up, we might let wip branches run tests and quality checks without blocking merges on other branches. For example, we can configure our CI tool to run tests on all branches but ignore failures on branches that begin with wip-. This lets us experiment freely without worrying about breaking the CI build. Once the code is stable, we can rename or merge the branch and expect a passing build.
Some teams set up branch protection rules on GitHub. Although there is nothing built into Git or GitHub that treats a wip branch differently, we can adopt naming conventions in our protection rules. For example, we might say that no protected rules apply to branches starting with wip-, allowing us to push force updates or skip certain checks as we work.
This flexibility can speed up the early development phase while still ensuring that our main branch remains well-protected.
To get the most out of wip branches, we should consider the following best practices.
Let’s always remember to use consistent naming conventions. If our team agrees that wip branches start with wip-, we should make sure everyone follows that pattern. For example, wip-login-flow or wip-db-refactor.
Ideally, wip branches should not live for too long. We should keep them short-lived and frequently updated. If a wip branch sits stale for weeks, it may become hard to merge or update. We should regularly integrate changes from main and refine the code as it matures.
If we’re working with a team, we should communicate about what our wip branch contains and why it is a work in progress. Updating colleagues on its status during stand-ups or weekly check-ins helps. The naming convention helps, but a short explanation in a pull request or project tracking system can go a long way.
As the code in a wip branch approaches completion, we can remove the wip designation. We can rename the branch before merging or create a new branch without wip- in the name once the code stabilizes. Transitioning from wip-new-feature to feature/new-feature might clearly mark that the work is now ready for final reviews.
Finally, the more common practice is to completely forget about using wip branches in lieu of GitHub’s draft pull requests. This provides a visual, platform-level way to signal that the code is not done. Anyone looking at the repository can quickly understand the state of the work.
In this article, we discussed a concept of a wip branch, which is simply a regular Git branch named in a way that signals it contains work in progress. This practice helps us avoid confusion, accidental merges, and misunderstandings.
Although wip is not an official Git or GitHub feature, it is a useful naming convention that naturally integrates into our existing workflows. When combined with tools like draft PRs, CI rules, and branch protection settings, a wip branch can make our development process more transparent and manageable.
As our code matures, we can drop the wip label, turning what was once an experimental branch into a fully reviewable feature branch ready for merging. In the end, the value of a wip branch lies in clear communication, improved teamwork, and a more organized workflow.