A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.gitlab.com/topics/git/branch/ below:

Create a Git branch for your changes

Help us learn about your current experience with the documentation.

Take the survey

.

Create a Git branch for your changes

A branch is a copy of the files in the repository at the time you create the branch. You can work in your branch without affecting other branches. When you’re ready to add your changes to the main codebase, you can merge your branch into the default branch, for example, main.

Use branches when you:

Create a branch

To create a branch:

git checkout -b <name-of-branch>

GitLab enforces branch naming rules to prevent problems, and provides branch naming patterns to streamline merge request creation.

Switch to a branch

All work in Git is done in a branch. You can switch between branches to see the state of the files and work in that branch.

To switch to an existing branch:

git checkout <name-of-branch>

For example, to change to the main branch:

Keep a branch up-to-date

Your branch does not automatically include changes merged to the default branch from other branches. To include changes merged after you created your branch, you must update your branch manually.

To update your branch with the latest changes in the default branch, either:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4