Building a Mini Branch Project in "Learning Git (Version Control)
Asked by Pradeep Balasubramanian about a year ago
I am not able to pass the "Building a Mini Branch Project" We need to create 4 branches and each branch should have content as mentioned in test cases.
In my case, only 'branch1' and 'surprise' branch have correct content when tested. But, I am sure 'branch2' and 'branch3' also have correct content.
Could some one help me to go past this step. All other steps in Git Step is completed.
Thanks,
Pradeep B
2 Answers
are you creating the files using "echo" ?
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