Git level 1 - challenge 2 make a branch

What did I do wrong here :

What is the exact name of the Git Level 1 task you’re trying to do – it’s not clear which task you mean. If I know, I can try this out and see what’s up with it.

Assuming that you’re doing Day 24 of 100 Days of Devops (“Git Create Branches”) – there’s no relevant Git Level 1 task – then:

  • The /usr/src/kodekloudrepo directory belongs to root, so you need to “sudo” into root.
  • You need to check to make sure that the current branch is “master” before you create the new branch.
[natasha@ststor01 ~]$ pushd /usr/src/kodekloudrepos/media/
/usr/src/kodekloudrepos/media ~
[natasha@ststor01 media]$ ls -l
total 8
-rw-r--r-- 1 root root 34 Oct  5 19:38 data.txt
-rw-r--r-- 1 root root 34 Oct  5 19:38 info.txt
[natasha@ststor01 media]$ cd ..
[natasha@ststor01 kodekloudrepos]$ ls -l
total 4
drwxr-xr-x 3 root root 4096 Oct  5 19:38 media
[natasha@ststor01 kodekloudrepos]$ sudo -i

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for natasha: 
[root@ststor01 ~]# pushd /usr/src/kodekloudrepos/media/
/usr/src/kodekloudrepos/media ~
[root@ststor01 media]# ls -l
total 8
-rw-r--r-- 1 root root 34 Oct  5 19:38 data.txt
-rw-r--r-- 1 root root 34 Oct  5 19:38 info.txt
[root@ststor01 media]# git status
On branch kodekloud_media
nothing to commit, working tree clean
[root@ststor01 media]# git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
[root@ststor01 media]# git checkout -b xfusioncorp_media
Switched to a new branch 'xfusioncorp_media'
[root@ststor01 media]# git status
On branch xfusioncorp_media

If you do that, the task should work.

1 Like

Thanks
Another problem solved