Skip to main content

Lab 005: Git Delete Branches

Requirements

Nautilus developers are actively working on one of the project repositories, /usr/src/kodekloudrepos/official. They were doing some testing and created few test branches, now they want to clean those test branches. Below are the requirements that have been shared with the DevOps team:

On Storage server in Stratos DC delete a branch named xfusioncorp_official from /usr/src/kodekloudrepos/official git repo.


Steps

Login to the Storage server and switch to root. For the server credentials, check out the Project Nautilus documentation.

sshpass -p '********' ssh -o StrictHostKeyChecking=no natasha@172.16.238.15
sudo su -
********

Proceed to the git repository and switch to master branch. Delete the specified branch and verify.

cd /usr/src/kodekloudrepos/official
[root@ststor01 official]# git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
[root@ststor01 official]#
[root@ststor01 official]# git branch -d xfusioncorp_official
Deleted branch xfusioncorp_official (was dbd9bdb).
[root@ststor01 official]#
[root@ststor01 official]# git branch
* master

Resources