Interstellar Git Hands-On Solutions
The Course Id of Interstellar Git is 61738.
1. Try it out: Cherry-Pick
cd test/
ls
cat greetings.sh
git checkout username
git log --pretty=oneline
git checkout master
git cherry-pick e0b8133a455874c673c3c41e3387b12b9560dd32
2. GIT STASH
cd file/
vi calc.py
Press i for INSERT then type below code
sum = float(num1) + float(num2)
+diff = float(num1)-float(num2)
=mul = float(num1) * float(num2)
+div = float(num1) / float(num2)
Esc -> :wq -> Enter
git stash (saved working directory)
vi calc.py
num1 = input('Enter first number: ')
num2 = input('Enter second numbr: ')
git add .
git commit -m 'STEP 4' (1 file changed)
git push origin master
git tag -a v1.0 -m "first"
git stash list
vi calc.py
[Press i]
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
+print('The difference of {0} and {1} is {2}'.format(num1, num2, diff))
+print('The product of {0} and {1} is {2}'.format(num1, num2, mul))
+print('The division of {0} and {1} is {2}'.format(num1, num2, div))
[Press ESC and type :wq]
git add .
git commit -m "step 7"
git tag -a v2.0 -m "second"
git push origin master
3. GIT BLAME
cd local/
ls
cat newfile.py
vi newfile.py
print('Hello World!!!')
This is the second line!
This is the third line!
a = 10+20
print(a)
git add .
git commit -m 'added two lines as step 2"
git push origin master
git blame newfile.py
touch output.txt
vi output.txt
This is the second line! (press i and type the line later ESC + :wq]
4. GIT Submodule
cd file/
mkdir vendor
cd vendor/
git submodule add /projects/challenge/.assessment/2
git status
git add .
git commit -m "on step2"
git push origin master
cd 2
vi dependency1.py
[press i and give space then ESC + :wq]
git add .
git commit -m "new line added"
git submodule status
cd ..
git status
git log --oneline
git add .
git commit -m "complete step3"
git push origin master
5. GIT REFLOG
cd file/
ls
touch file4.py
vi file4.py [:wq and press enter]
git add .
git commit -m "New file added"
git push origin master
git reflog
git reset --hard Head~1
git reflog
git cherry-pick a297431 (commit id of New file added)
git reset --hard
6. GIT HOOKS
cd test/
cd .git/hooks/
touch post-commit
vi post-commit
git push origin master [ESC + :wq enter]
chmod +x post-commit
cd ..
cd ..
touch new_file.txt
git add .
git commit -a -m "commitMessage"
7. GIT BISECT
cd local/
ls
cat newfile.py
git log --oneline
git bisect start
git bisect good 72c7e9d (perform addition)
git bisect bad
cat newfile.py
git bisect bad
cat newfile.py
git bisect good (when you see b = 20)
git bisect reset
git revert 317f20..... (commit id above you will see) [Ignore Errors]
git commit -u newfile.py ( Nothing just type :wq and Enter]
git add .
git commit -m "revert"
git push origin master
Hi,
ReplyDeleteGIT BISECT hands on is not fully working, 4/6 test cases only passing, please check the code,thanks
GIt submodules are not working
Deleteyes bro....
DeleteYes bro..Git Submodule Are not Working..Please any one Provide Solution....
DeleteYes Submodule and Git Blame hands on is not Working.. could You Check the Code...Thanks...
Deleteis working you need change the part of message of commit. Also this is the secondline you need to put on output.txt
Delete7. GIT BISECT
ReplyDeletecd local/
ls
cat newfile.py
git log --oneline
git bisect start
git bisect good 72c7e9d (perform addition)
git bisect bad
cat newfile.py
git bisect bad
cat newfile.py
git bisect good (when you see b = 20)
git bisect reset
git revert 317f20..... (commit id above you will see) [Ignore Errors]
git revert is not working please help
7. GIT BISECT
ReplyDeletecd local/
ls
cat newfile.py
git log --oneline
git bisect start
git bisect good 72c7e9d (perform addition)
git bisect bad
cat newfile.py
git bisect bad
cat newfile.py
git bisect good (when you see b = 20)
git bisect reset
git revert 317f20..... (commit id above you will see) [Ignore Errors]
Please help
Git revert not working.
Hello bro
ReplyDeleteAsalu ela cheyaloo ardam avatam ledu bro,pls help cheyandi bro only handson pending
Me to same, pending hands on but bisect and submodule
DeleteIn git submodule , CD 2, is not available in the directory, how to change it, and while create new one how to work on it please help me
Deletecd local/
ReplyDeletels
cat newfile.py
git log --oneline
git bisect start
git bisect good 72c7e9d (perform addition)
git bisect bad
cat newfile.py
git bisect bad
cat newfile.py
git bisect good (when you see b = 20)
git bisect reset
git revert 317f20..... (commit id above you will see) [Ignore Errors]
Here 317f20.... hash is the sha of bad commit which you will get when you run the above command bisect good or reset.
git commit -u newfile.py ( Nothing just type :wq and Enter]
git add .
git commit -m "revert"
got pull origin
git push origin master
Thanks man you saved us
Deletegit revert --continue
DeleteI'm not able to complete this test it's showing like error is git revert fail plz healp me
DeleteBro git bisect
DeleteRevert checks failed
Tried lot of times but failed
Add these two below lines after : git commit -m "revert"
Deletegit pull --rebase
git push
This is the correct solution all test get passed
DeleteRevert Check... Fail
Deleteis failing under 7. GIT BISECT. Is it possible to correct code here .. ?
bisect revert test case failing. help please......
ReplyDeleteFor command git cherry-pick e0... The terminal output is fatal: bad object e0... What should we do in that case
ReplyDeleteGit bisect revert is failing.. Not sure which hash to be taken.. could you please add screenshot and highlight it
ReplyDeleteNone of the course hands on working ..all got failed ..plz provide interstellar git hands on
ReplyDeleteI think these below commands are required for cherry-pick
ReplyDeletegit add .
git cherry-pick --continue
Many thanks, adding these commands helped me in clearing cherry pick hands on
DeleteGit bisect and cheerypick is not working .plz somebody help me
ReplyDeleteAfter - git commit -u newfile.py - follow the below steps
Deletegit revert 317f20.....
git add .
git commit Revert "Perfom Calucultion"
git push origin master
test pass.................
Please update the git bisect
ReplyDeletePls help me for git submodule code, it's not able to execute
ReplyDeleteBro, please. Help me for GIT SUBMODLE CODEA, IT'S NOT executive 2 test cases, please help. Me , this
ReplyDeletecode
Thanks
ReplyDeleteThe sobmodule is not working it says clonr failed
ReplyDeletegit submodule is not working for me...
ReplyDeletepriminary local directory checks in local repository.. under this commit check is fail.... please help
git reflog ... In reset command, Head shud be all Caps ...
ReplyDeletegit reset --hard HEAD~1
Can you please post the correct code for Cherry-Pick ? The above doesnot seem to work.
ReplyDeleteCherry-Pick is not working, please help!
ReplyDelete1. Try it out: Cherry-Pick is not working
ReplyDelete1. Try it out: Cherry-Pick is not workingggg
ReplyDeletegit blame is not working "output file check is fail" plz help me
ReplyDelete