Followers

Git revert - Assignment

1.   Create a file application.properties in your current local git repo. 2. Modify file by adding content "domain=devopsworld.co.in&qu...


1.  Create a file application.properties in your current local git repo.

2. Modify file by adding content "domain=devopsworld.co.in" and commit the changes in to local repo

3. Revert back the changes of application.properties file

4. Confirm the changes are undone.

5. Delete application.properties file without deleting the commits with git revert command.

COMMENTS

BLOGGER: 10
  1. Step 1:
    720 touch APPlication.properties
    721 git add .
    722 git commit -m "APPlication.properties added"
    723 git log --oneline
    Step 2:
    724 echo "domain=devopsworld.co.in" > APPlication.properties
    725 git status
    726 git add .
    727 git commicommit -m "APPlication.properties added"
    728 commit -m "APPlication.properties added"
    729 git commit -m "APPlication.properties has been modified"
    730 git log --oneline
    Step 3:
    731 git revert 59a550c
    Step 4:
    732 cat APPlication.properties
    Yes
    Step 5:
    733 git revert 219ab23
    734 git log --oneline

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. 498 ls
      499 touch application.properties
      500 git add application.properties
      501 git commit -m "application.properties is added"
      502 git log --oneline
      503 echo "domain=devopsworld.co.in" >> application.properties
      504 git status
      505 git add application.properties
      506 git commit -m "application.properties is modified"
      507 git log --oneline
      508 git revert ee56bad
      509 git log --oneline
      510 cat application.properties
      511 git revert 9608f6f
      512 ls
      513 git log --oneline
      514 history

      Delete
  3. Ans 1: 186 touch application.properties
    187 git status
    188 git add .
    189 git commit -m "adding application.properties"
    190 git log --oneline

    Ans 2: 191 echo "domain=devopsworld.co.in" >> application.properties
    192 cat application.properties
    193 git add .
    194 git commit -m "application.properties has been modified"
    195 git log --oneline

    Ans 3: 196 git revert 756e60b

    Ans 4: 197 cat application.properties

    Ans 5: 198 git log --oneline
    199 git revert f5f571b
    200 ls
    201 history

    ReplyDelete
  4. 1. touch application.properties
    git add application.properties
    git commit -m "application.properties file is added"

    2. echo "domain=devopsworld.co.in" >> application.properties
    git add application.properties
    git commit -m "application.properties file is modified"

    3. git oneline
    git revert *******
    4. git log --online
    cat application.properties

    5. git revert *******
    git log --oneline
    cat application.properties

    ReplyDelete
  5. 1: touch application.properties
    git add application.properties
    git commit -m "package.properties is added"

    2: echo " domain=devopsworld.co.in" >> application.properties
    git add application.properties
    git commit -m "package.properties is added"
    git log --oneline

    3: git revert 9932c46
    git log --oneline

    4: cat application.properties

    5: git revert 3099c07
    git log --oneline

    ReplyDelete
  6. Asyraf

    159 touch file.properties
    160 ls
    161 echo "domain=devopsworld.co.in" >> file.properties
    162 git add file.properties
    163 git commit -m
    164 git commit -m "file.properties is being added"
    165 git log --oneline
    166 git revert 4949baf
    167 git log --oneline
    168 git revert 630ac47
    169 git log --oneline
    170 history

    ReplyDelete
  7. Ans 1:
    Date: Wed Feb 9 02:19:28 2022 +0000

    package.json was updated

    commit d15ea3dc6c948d3c08d6503f703ccb5e723329a5
    Author: ritika
    Date: Wed Feb 9 02:16:42 2022 +0000

    package is added

    commit a6beb112daf45ef125d3f2fea8c717eed33056f0
    Author: ritika
    Date: Wed Feb 9 01:53:43 2022 +0000

    tmp is added now

    commit 5a733f1f44c287aefca1dd7a986346a130272091
    Author: kenneth
    Date: Tue Feb 8 06:56:56 2022 +0000

    myfile is added
    root@ubuntu1804:/home/vagrant/MyProj#
    root@ubuntu1804:/home/vagrant/MyProj# git log --oneline
    42c8f13 (HEAD -> master) 2nd change
    284fa7b ok done
    735ef7d Revert "Revert "package.json was updated""
    eacfc5d Revert "package.json was updated"
    ebe731b package.json was updated
    d15ea3d package is added
    a6beb11 tmp is added now
    5a733f1 myfile is added
    root@ubuntu1804:/home/vagrant/MyProj# git revert 42c8f13
    [master 79749f5] Revert "2nd change"
    1 file changed, 1 deletion(-)
    root@ubuntu1804:/home/vagrant/MyProj# cat app.properties
    domain=devopsworld.co.in
    root@ubuntu1804:/home/vagrant/MyProj# rm app.properties

    ReplyDelete
  8. 565 touch application.properties
    566 git add application.properties
    567 git commit -m "application.properties file is added"
    568 echo "domain=devopsworld.co.in" >> application.properties
    569 git add application.properties
    570 git commit -m "application.properties file is modified"
    571 git log --oneline
    572 git revert 7a9e337
    573 git log --online
    574 git log --oneline
    575 cat application.properties
    576 git revert 4c60965
    577 git log --oneline
    578 cat application.properties
    579 history

    ReplyDelete

Name

Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
ltr
item
DevOpsWorld: Git revert - Assignment
Git revert - Assignment
DevOpsWorld
https://www.devopsworld.co.in/2022/02/git-revert-assignment.html
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/
https://www.devopsworld.co.in/2022/02/git-revert-assignment.html
true
5997357714110665304
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content