32/100 Git Rebase
The Nautilus application development team has been working on a project repository /opt/media.git
. This repo is cloned at /usr/src/kodekloudrepos
on storage server
in Stratos DC
. They recently shared the following requirements with DevOps team:
One of the developers is working on feature
branch and their work is still in progress, however there are some changes which have been pushed into the master
branch, the developer now wants to rebase
the feature
branch with the master
branch without loosing any data from the feature
branch, also they don't want to add any merge commit
by simply merging the master
branch into the feature
branch. Accomplish this task as per requirements mentioned.
Also remember to push your changes once done.
ssh natasha@ststor01
sudo su -
cd /usr/src/kodekloudrepos/media
[root@ststor01 media]# ls
feature.txt info.txt
[root@ststor01 media]# git branch
* feature
master
[root@ststor01 media]# git rebase master feature
Successfully rebased and updated refs/heads/feature.
[root@ststor01 media]# git config pull.rebase true
[root@ststor01 media]# git pull origin feature
From /opt/media
* branch feature -> FETCH_HEAD
warning: skipped previously applied commit c10c1e2
hint: use --reapply-cherry-picks to include skipped commits
hint: Disable this message with "git config advice.skippedCherryPicks false"
Successfully rebased and updated refs/heads/feature.
[root@ststor01 media]# git push origin feature
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 312 bytes | 312.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To /opt/media.git
720aa19..db95855 feature -> feature