Tuesday, February 8, 2022

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" 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.

10 comments:

Jerome said...

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

Muhd Irfan Abdul Rahman said...
This comment has been removed by the author.
Muhd Irfan Abdul Rahman said...

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

Naveen said...

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

Pong said...

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

Unknown said...

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

Asyraf said...

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

Ken said...

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

Pong said...

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

Pong said...

pong

Post a Comment