Prodigious Git_FP Hands_On Solutions
Course Id:- 61739
These Hands_On Solutions is only for Learning Purpose who are stuck to clear these solutions will help you.
Click on Terminal and write
1. Committing Files
git init
ls
cd test
ls
git add helloworld.js
git commit -m "Initial Hello World Commit"
echo '*.tmp' > .gitignore
git add .gitignore
git commit -m "gitignore file"
2. committing changes
git status
git diff
ls
cd test
ls
git add committed.js
git diff --staged
git log --pretty=format:"%h %an %ar - %s"
git show
(In case if you failed at commits check on master)
git commit -m 'hello' (Use this after git diff command)
3. Working on Remote
ls
cd test
git init
git remote add origin ../.assessment/remote
git remote -v
touch abc.txt
git add abc.txt
git commit -m "new file abc.txt"
git push origin master
cd ..
bash .clone_sh
ls
cd test
git pull origin master
cd ..
ls
cd clone
git clone https://github.com/frescoplaylab/hello-world.git
4. Try it Out - Branch and Merge Conflicts
cd test
git init
git checkout -b feature1
git checkout -b feature2
git checkout feature1
vi hello.py
(Press i then make print('Hello people') then esc and type :wq)
git add hello.py
git commit -m 'changed from feature1'
git checkout master
git merge feature1
git checkout feature2
vi hello.py
(print('keep playing'))
git add hello.py
git commit -m 'changed from feature2'
git checkout master
git merge feature2
vi hello.py
(print('keep playing'))
git add hello.py
git commit -m 'resolved conflicts'
git branch -d feature1
git branch -d feature2
cd ../quotes/
vi Quotes.txt
(My life is my message.Mahatma Gandhi.)
git add Quotes.txt
git commit -m 'added gandhi quote'
git pull origin master --allow-unrelated-histories
git checkout --ours Quotes.txt
git add Quotes.txt
git commit -m 'resolved conflicts'
git push origin master
vi Quotes.txt
(My life is my message. Mahatma Gandhi. Adding conflicts )
git add Quotes.txt
git commit -m 'final commit'
git push origin master
5. Rebase Conflict
git clone .assessment/remote
cd remote
vi check_number.py
(Press i then
num = 2
if (num % 2) == 0:
print("{0} is Even".format(num))
else: print('{0} is Odd'.format(num))
Press esc then :wq)
git add check_number.py
git commit -m 'modified'
cd ..
bash .fetch_sh
cd remote
git diff master origin/master
(:wq)
git pull --rebase origin master
vi check_number.py
(
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else: print('{0} is Odd'.format(num))
)
git add check_number.py
git rebase --continue
git push origin master
6. Undo Changes
cd test
vi hello.py
(Press i then make the file
print("Hello World")
(Then press esc and type :wq)
git add hello.py
git commit --amend
(type :wq)
vi hello.py
(
print("Hello world")
Adding but to file
)
git checkout --hello.py
vi hello.py
(
print("Hello world")
Adding bug to file
)
git add hello.py
git reset hello.py
git add hello.py
git reset --hard
vi hello.py
(
print("Hello world")
print("Added bug to script")
)
git add hello.py
git commit -m 'changed hello.py'
git reset HEAD~1
git commit -am "commit to revert"
git revert HEAD
git revert HEAD...HEAD~3 --no-edit
please share interstellar GIT hands on as well. Thanks.
ReplyDeleteThanks.
ReplyDeletecommit check on master is failing ..help me out here anyone please.
ReplyDelete--allow-unrelated-histories
DeleteAbove is the correct.
hi same for me did u find the solution
DeleteFor commit check on master is failing issue run below command after (git diff --staged)
Deleteit commit -m 'hello'
and run git log --pretty=format:"%h %an %ar - %s"
Could you please tell if fail in change of files then what is solution for that
Deletein the same path please run the below command
Deletesudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt install git
for branch and merge conflicts i am getting commits check on master'fail ..can anyone helpme out??
ReplyDeleteplease share interstellar GIT hands on as well. Thanks
ReplyDeleteHi, Already Uploaded. Please check:- https://www.tejatechview.com/2022/02/interstellar-git-hacker-rank-hands-on.html
DeleteIt is asking for username and password in working in remote hands-on question what to give in that
ReplyDeleteCheck remote url while cloning
DeleteEven i am facing the same issue can some one pls show us the solution for this
DeletePlease help to upload maven - coalescing pipeline handsons as well
ReplyDeleteCan anyone plz help me out with the error commits check master fail...some one suggested to allow historie ..but where should we do it ..plz help me ...@tejatechupdate
ReplyDeleteWorking on remote is giving error. Git push origin master showing no git repo ../. assesment/remote even though I have added the origin. Please help
ReplyDeleteDid you get solution for it
DeleteCan you please upload angular 2 mini project course id-64449?
ReplyDeletePlease Shere the developers git and cucumber hands on please
ReplyDeletefor try it out branch & merge my handson test cases not passes only getting half pass half fail please help code not working
ReplyDeletesame
DeleteBranch and
DeleteMerge Conflicts Share code
Thank you so much! It helped to realise where I was going wrong. For branch and merge conflicts I had overseen step 2.
ReplyDeleteKindly share correct code for Rebase Conflict. I am getting below error.
DeletePreliminary local directory checks in local repository... Pass
Commits check on master... Fail
file check... Pass
Preliminary remote directory checks in local repository... Pass
Commits check on master... Fail
file check... Pass
Share correct code for Branch and Merge conflict - it sfailing in 2nd step
DeleteSame I got file check... Fail
DeleteWorking on remote, asnwer is not showing all test cases correctly
ReplyDeletePlease reprovide working on remote handson
ReplyDeleteCould you please help us with Ansible hands on Answers as well
ReplyDeleteWorking on remote is giving error. Git push origin master showing no git repo ../. assesment/remote even though I have added the origin. also it is asking for some username and password to proceed.
ReplyDeleteTry to Reset your project (there is a option in the test window) and run bash .install_sh . After that try to do the process again
DeleteThanks a lot for your help😇
ReplyDeletethis code not run how to run this code pls tell me
ReplyDeleteBranch and
ReplyDeleteMerge Conflicts Share code
Can you please share correction code.
DeleteBranch and
ReplyDeleteMerge Conflicts
Hi bro it's keeps on master failing..please help
ReplyDeleteTry it Out - Branch and Merge Conflicts is not working with me facing problem can you help me pls
ReplyDeleteTry it Out - Branch and Merge Conflicts is not working can you send us new code pls
ReplyDeletegit pull origin master --allow-unrelated-histories
ReplyDeleteIs not working under Branch and Merge Conflicts
Error : Unknown options 'allow-unrelated-histories'
Please h here..
Thanks to all the contributor, it was an awesome experience
ReplyDeletecd ../quotes/ not found. Can you help me with alternative command
ReplyDeleteHelp me on branch and merge conflicts code. Getting error.
ReplyDelete