> Prodigious Git_FP Hands_On Solutions - TECH UPDATE

Prodigious Git_FP Hands_On Solutions

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


Prodigious Git_FP Hands_On Solutions Prodigious Git_FP Hands_On Solutions Reviewed by TECH UPDATE on November 30, 2021 Rating: 5

42 comments:

  1. please share interstellar GIT hands on as well. Thanks.

    ReplyDelete
  2. commit check on master is failing ..help me out here anyone please.

    ReplyDelete
    Replies
    1. --allow-unrelated-histories

      Above is the correct.

      Delete
    2. hi same for me did u find the solution

      Delete
    3. For commit check on master is failing issue run below command after (git diff --staged)

      it commit -m 'hello'

      and run git log --pretty=format:"%h %an %ar - %s"

      Delete
    4. Could you please tell if fail in change of files then what is solution for that

      Delete
    5. in the same path please run the below command
      sudo add-apt-repository ppa:git-core/ppa
      sudo apt-get update
      sudo apt install git

      Delete
  3. for branch and merge conflicts i am getting commits check on master'fail ..can anyone helpme out??

    ReplyDelete
  4. please share interstellar GIT hands on as well. Thanks

    ReplyDelete
    Replies
    1. Hi, Already Uploaded. Please check:- https://www.tejatechview.com/2022/02/interstellar-git-hacker-rank-hands-on.html

      Delete
  5. It is asking for username and password in working in remote hands-on question what to give in that

    ReplyDelete
    Replies
    1. Check remote url while cloning

      Delete
    2. Even i am facing the same issue can some one pls show us the solution for this

      Delete
  6. Please help to upload maven - coalescing pipeline handsons as well

    ReplyDelete
  7. Can 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

    ReplyDelete
  8. Working on remote is giving error. Git push origin master showing no git repo ../. assesment/remote even though I have added the origin. Please help

    ReplyDelete
  9. Can you please upload angular 2 mini project course id-64449?

    ReplyDelete
  10. Please Shere the developers git and cucumber hands on please

    ReplyDelete
  11. for try it out branch & merge my handson test cases not passes only getting half pass half fail please help code not working

    ReplyDelete
  12. Thank you so much! It helped to realise where I was going wrong. For branch and merge conflicts I had overseen step 2.

    ReplyDelete
    Replies
    1. Kindly share correct code for Rebase Conflict. I am getting below error.

      Preliminary 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

      Delete
    2. Share correct code for Branch and Merge conflict - it sfailing in 2nd step

      Delete
    3. Same I got file check... Fail

      Delete
  13. Working on remote, asnwer is not showing all test cases correctly

    ReplyDelete
  14. Please reprovide working on remote handson

    ReplyDelete
  15. Could you please help us with Ansible hands on Answers as well

    ReplyDelete
  16. Working 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.

    ReplyDelete
    Replies
    1. Try 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

      Delete
  17. Thanks a lot for your help😇

    ReplyDelete
  18. this code not run how to run this code pls tell me

    ReplyDelete
  19. Branch and
    Merge Conflicts Share code

    ReplyDelete
  20. Branch and
    Merge Conflicts

    ReplyDelete
  21. Hi bro it's keeps on master failing..please help

    ReplyDelete
  22. Try it Out - Branch and Merge Conflicts is not working with me facing problem can you help me pls

    ReplyDelete
  23. Try it Out - Branch and Merge Conflicts is not working can you send us new code pls

    ReplyDelete
  24. git pull origin master --allow-unrelated-histories

    Is not working under Branch and Merge Conflicts

    Error : Unknown options 'allow-unrelated-histories'

    Please h here..


    ReplyDelete
  25. Thanks to all the contributor, it was an awesome experience

    ReplyDelete
  26. cd ../quotes/ not found. Can you help me with alternative command

    ReplyDelete

Powered by Blogger.