1) The “git reset –soft ” command:

a) Adds a commit which undoes all file changes made in <commit-id>
b) Add a commit which undoes all file changes since <commit-id>
c) Removes all commits and file changes since <commit-id>
d) Removes all commits since <commit-id> but keeps the changes in files

Answer(s) : 
d) Removes all commits since commit-id but keeps the changes in files

2) The “git fetch” command:

a) Pulls updates from remote for current branch but does not apply them on local branch
b) Pulls updates from remote for current branch and applies them on local branch

c) Pulls updates from remote for all branches but does not apply them on local branches
d) Pulls updates from remote for all branches and applies them on all local branches

Answer(s) : 
c) Pulls updates from remote for all branches but does not apply them on local branches

3) Which of the following is enough to recreate an existing git project on your local (along with the version info):

a) All files comprising the project which were committed to git
b) The .git folder present in the project
c) Link to a public gitlab repository hosting the project
d) None of the above

Answer(s) : 
b) The .git folder present in the project
c) Link to a public gitlab repository hosting the project

4) The “git stash” command:

a) Is used to delete uncommitted changes in files
b) Is used to save uncommitted changes in files for later

c) Is used to recover deleted commits from a branch
d) Is used to recover deleted files from a project

Answer(s) : 
b) Is used to save uncommitted changes in files for later

5) Which flag for the “git commit” command is used to make a change to a commit just made in git:

a) –modify
b) –amend
c) –change
d) –update

Answer(s) : 
b) --amend

6) Which of the following are popular services which help host remote git repositories:

a) Github
b) Bitlab
c) Gitbucket
d) Bitbucket

Answer(s) : 
a) Github
d) Bitbucket

7) Adding the line “src/*.txt” to the .gitignore file of a git project ensures:

a) All .txt files will now not be tracked by git
b) All .txt files in src folder will now not be tracked by git
c) All .txt files in src folder and its subdirectories will now not be tracked by git
d) All .txt files in src folder which are not already being tracked will not be tracked by git

Answer(s) : 
d) All .txt files in src folder which are not already being tracked will not be tracked by git 

8) Which of the following git commands is used to output the list of commits made on current branch:

a) Git log
b) Git commit list
c) Git status
d) Git ls-tree

Answer(s) : 
a) Git log

9) Which of the following commands can cause a file to be in conflict state which will have to resolved:

a) Git pull
b) Git push
c) Git merge <branch>
d) Git checkout <branch>

Answer(s) : 
a) Git pull
c) Git merge branch

10) Which of the following commands is used to delete a remote branch:

a) Git branch -D <branch>
b) Git branch -d <branch>
c) Git push origin :<branch>
d) Git branch -D <branch> && git push origin <branch>

Answer(s) : 
c) Git push origin :branch
Categories: NPTEL solution

24 Comments

VIKRAM SHINDE · September 21, 2017 at 6:37 PM

tysm bro….really helped me a lot for checking my answers n getting me right….and ya also from loosing my important marks 🙂

    Yash Sodha · September 23, 2017 at 4:00 AM

    😀

technoguy · September 22, 2017 at 8:07 AM

Great Work from the Team,

Requesting for the final exam online solution going to held on 24th september….2-5pm slot..

please be fast….

    Yash Sodha · September 23, 2017 at 4:00 AM

    That would not be possible as it’s an exam and it’s going to be at the exam centre. Keep supporting! Thanks!

Mani · September 22, 2017 at 2:40 PM

Good job sir!!

For the 5th assignment my staff gave me the answers and I scored only 90. I was depressed. While surfing in the internet, I referred hackademic for the assignments 6&7 and scored 100 in both of them. Sounds great!!. Thank you so much!!

    Mani · September 23, 2017 at 1:05 PM

    Hai Sir

ke$u · September 23, 2017 at 12:42 AM

Please update 2-5pm sample question papers

Prerna Rao · September 23, 2017 at 1:56 AM

Thank you for this post….. Also please help us during the 24th September IMAD exam

    Yash Sodha · September 23, 2017 at 3:59 AM

    That would not be possible as it’s an exam and it’s going to be at the exam centre. Keep supporting! Thanks!

technoguy · September 23, 2017 at 3:38 AM

Hi Team ,

Highly appreciatable work….

Please upload the solution for the final exam going to be held on 24th sept.

thanks

Hiranmai · September 24, 2017 at 3:01 PM

Please keep the solutions of sample test today is the last date

Divya · September 26, 2017 at 5:36 AM

Hi Sir,
Upload the solutions for hasura online exam which is on sep 30th
please be fast..!

Sheetal Jain · September 28, 2017 at 1:45 PM

I know i am late but u really helped me with my assignments…. Thank you so much. Can u also help during the online imad test on Sat, Sept 30?

Raju · September 29, 2017 at 7:12 AM

Can you publish the questions for tomorrow’s exam?

Rajani · September 30, 2017 at 8:01 AM

Hi team I secured 100% marks in week 7 while surfing on the internet I got to know about this.
Why don’t you help us for today’s exam also. So that we will be securing more marks.

pcm · September 30, 2017 at 9:34 AM

can you please put Hasura’s exam.

Rishab · September 30, 2017 at 2:00 PM

Please can you upload the solution for todays exam.

Rajani · October 3, 2017 at 8:20 AM

Hi team please send me hasura exam answer key held on sep 30

sai · January 11, 2018 at 2:53 PM

hi Team,
Can u please say the courses that u gonna provide solutions for coming nptel courses.

    Yash Sodha · January 11, 2018 at 2:57 PM

    Yes, we will be providing solutions to the NPTEL courses this time too 🙂 please comment the course which you are taking this time, and we I’ll try to cover it too!

sai · January 17, 2018 at 4:20 PM

courses : Data mining and IMAD
please provide solutions for this courses 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *