codedamn

Git mini branch project not working

Asked by Mayank Maurya about a year ago

3

I was attempting the git mini branch project -(version control system - lecture 19) but even though I have followed the instruction and unable to passed the all the test.

1 Answer

    1

    I'm writing down in steps to make it easier: Step 1 : git init

    Step 2 : git add .

    Step 3 : git commit -m "initial files "

    Here you will get an error to config:

    *** Please tell me who you are.

    Run

    git config --global user.email "[email protected]"

    git config --global user.name "Your Name"

    to set your account's default identity.

    Omit --global to set the identity only in this repository.

    fatal: unable to auto-detect email address (got 'damner@codedamn.(none)')

    Step 4 : Let's config

    git config --global user.email "[email protected]"

    git config --global user.name "codedamn"

    Step 5 : git commit -m "initial files"

    Step 6 : let's make our first branch that is branch1

    git checkout -b branch1

    Step 7 : Now we are on branch 1,let's create a new file named numbers.txt Click on copy paste icon on top left , and you'll be able to view files .So here create a new file named numbers.txt

    Step 8 : add content 1 in numbers.txt

    Step 9 : git add .

    Step 10 : git commit -m "add numbers.txt"

    Here our first challenge is completed. i.e branch1 should contain correct files

    Step 11 :Lets create second branch

    git checkout -b branch2

    Step 12 : add 2 to numbers.txt ,you can do step 7 to view numbers.txt and edit

    Step 13 : git add .

    Step 14 : git commit -m "add branch2"

    Here our second challenge is completed. i.e branch2 should contain correct files

    Step 15 : git checkout -b branch3

    Step 16: add 3 to numbers.txt ,you can do step 7 to view numbers.txt and edit

    Step 17 : git add .

    Step 18 : git commit -m "add branch3"

    Here our third challenge is completed. i.e branch2 should contain correct files

    Step 19 : git checkout -b surprise

    Step 20 : follow Step 7 to create a new file named surprise.txt with the content "This is an awesome lab and course on git and I'm loving it."

    Step 21 : git add .

    Step 22 : git commit -m "add surprise.txt"

    Here our fourth challenge is completed. i.e surprise branch should contain correct files

Your answer