- GitLab Tutorial
- GitLab - Home
- GitLab Basics
- GitLab - Introduction
- GitLab - Installation
- GitLab - Git Commands
- GitLab - SSH Key Setup
- GitLab - Create Project
- GitLab - Fork a Project
- GitLab - Create a Branch
- GitLab - Add a File
- GitLab - Rebase Operation
- GitLab - Squashing Commits
- GitLab Users and Groups
- GitLab - Adding Users
- GitLab - Create Groups
- GitLab - Remove Users
- GitLab - User Permissions
- GitLab Issue Tracker
- GitLab - Create Issue
- GitLab - Merge Requests
- GitLab - Referencing Issues
- GitLab - Milestones
- GitLab - Wiki Pages
- GitLab Instance Management
- GitLab - Create Backup
- GitLab - Restore Backup
- GitLab - Import Repository
GitLab - Rebase Operation
Description
Rebase is a way of merging master to your branch when you are working with long running branch.
Steps for Rebase Operation
Step 1 − Go to your project directory and create a new branch with the name rebase-example by using the git checkout command −
The flag -b indicates new branch name.
Step 2 − Now, create a new file and add some content to that file as shown below −
The content 'Welcome to Tutorialspoint' will be added to the rebase_file.md file.
Step 3 − Add the new file to working directory and store the changes to the repository along with the message (by using the git commit command) as shown below −
The flag -m is used for adding a message on the commit.
Step 4 − Now, switch to the 'master' branch. You can fetch the remote branch(master is a branch name) by using the git checkout command −
Step 5 − Next, create an another new file, add some content to that file and commit it in the master branch.
Step 6 − Switch to the rebase-branch to have the commit of master branch.
Step 7 − Now, you can combine the commit of master branch to rebase-branch by using the git rebase command −
To Continue Learning Please Login
Login with Google