Showing posts with label GIT. Show all posts
Showing posts with label GIT. Show all posts

Wednesday, 4 September 2019

Git Stashing by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git stash
Saved working directory and index state WIP on master: 0199c9d changes

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi start2.txt

/usr/bin/bash: q: command not found

shell returned 127

Press ENTER or type command to continue

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -am "changes"
[master a5f84da] changes
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git stash apply
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$

Git Rebasing by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ which git
/mingw64/bin/git

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout -b myfeature
Switched to a new branch 'myfeature'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git status
On branch myfeature
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git commit -am "changes"
[myfeature 241ea57] changes
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git status
On branch myfeature
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 8 commits.
  (use "git push" to publish your local commits)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 8 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -am "changes"
[master af11240] changes
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 9 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --decorate --all --graph
* af11240 (HEAD -> master) changes
| * 241ea57 (myfeature) changes
|/
* 715560d master changes
| * e5164f5 (realwork) changes
|/
*   9fc9b59 Merging changes from simple-changes brance
|\
| * 7fffcc8 adding
* | 7277340 adding
|/
*   39c29d9 Merge branch 'add-copyright' Raj
|\
| * de62fc3 adding line
| * 8746b9d Adding copyright notice
|/
* 218d0ee changes done to file
* cbb7ab4 (origin/master, origin/HEAD) commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git brances
git: 'brances' is not a git command. See 'git --help'.

The most similar command is
        branch

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master
  myfeature
  realwork

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d realwork
error: The branch 'realwork' is not fully merged.
If you are sure you want to delete it, run 'git branch -D realwork'.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -D realwork
Deleted branch realwork (was e5164f5).

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master
  myfeature

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout myfeature
Switched to branch 'myfeature'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: changes

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git log --oneline --decorate --all --graph
* 97c0cb7 (HEAD -> myfeature) changes
* af11240 (master) changes
* 715560d master changes
*   9fc9b59 Merging changes from simple-changes brance
|\
| * 7fffcc8 adding
* | 7277340 adding
|/
*   39c29d9 Merge branch 'add-copyright' Raj
|\
| * de62fc3 adding line
| * 8746b9d Adding copyright notice
|/
* 218d0ee changes done to file
* cbb7ab4 (origin/master, origin/HEAD) commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git status
On branch myfeature
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git commit -am "adding"
[myfeature 769e39c] adding
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git status
On branch myfeature
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (myfeature)
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 9 commits.
  (use "git push" to publish your local commits)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d myfeature
error: The branch 'myfeature' is not fully merged.
If you are sure you want to delete it, run 'git branch -D myfeature'.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git merg myfeature
git: 'merg' is not a git command. See 'git --help'.

The most similar commands are
        merge
        grep
        mktree

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git merge myfeature
Updating af11240..769e39c
Fast-forward
 README.md  | 2 +-
 start2.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d myfeature
Deleted branch myfeature (was 769e39c).

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 11 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -am "changes"
[master 92a780f] changes
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout -b big
Switched to a new branch 'big'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git status
On branch big
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git commit -am "changes"
[big d05fb70] changes
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git status
On branch big
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 12 commits.
  (use "git push" to publish your local commits)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 12 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -am "changes"
[master 7ffb2d1] changes
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 13 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --decorate --all --graph
* 7ffb2d1 (HEAD -> master) changes
| * d05fb70 (big) changes
|/
* 92a780f changes
* 769e39c adding
* 97c0cb7 changes
* af11240 changes
* 715560d master changes
*   9fc9b59 Merging changes from simple-changes brance
|\
| * 7fffcc8 adding
* | 7277340 adding
|/
*   39c29d9 Merge branch 'add-copyright' Raj
|\
| * de62fc3 adding line
| * 8746b9d Adding copyright notice
|/
* 218d0ee changes done to file
* cbb7ab4 (origin/master, origin/HEAD) commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout big
Switched to branch 'big'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git branch
* big
  master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git difftool master big

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git rebase mmaster
fatal: invalid upstream 'mmaster'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git rebase master
First, rewinding head to replay your work on top of it...

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git rebase --abort
fatal: No rebase in progress?

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git mergetool
No files need merging

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (big)
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 13 commits.
  (use "git push" to publish your local commits)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git pull orgin master
fatal: 'orgin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git pull origin master
From https://github.com/rajkumargupta14/hello-world
 * branch            master     -> FETCH_HEAD
Already up to date.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git push origin master
Enumerating objects: 26, done.
Counting objects: 100% (26/26), done.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (23/23), 2.05 KiB | 233.00 KiB/s, done.
Total 23 (delta 15), reused 1 (delta 0)
remote: Resolving deltas: 100% (15/15), completed with 2 local objects.
To https://github.com/rajkumargupta14/hello-world.git
   cbb7ab4..7ffb2d1  master -> master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -am "changes"
[master 87d3aad] changes
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git fetch origin master
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 3 (delta 2), reused 2 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/rajkumargupta14/hello-world
 * branch            master     -> FETCH_HEAD
   7ffb2d1..01e33a7  master     -> origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git pull --rebase origin master
From https://github.com/rajkumargupta14/hello-world
 * branch            master     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: changes

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --decorate --all --graph
* 0199c9d (HEAD -> master) changes
* 01e33a7 (origin/master, origin/HEAD) remte
* 7ffb2d1 (big) changes
* 92a780f changes
* 769e39c adding
* 97c0cb7 changes
* af11240 changes
* 715560d master changes
*   9fc9b59 Merging changes from simple-changes brance
|\
| * 7fffcc8 adding
* | 7277340 adding
|/
*   39c29d9 Merge branch 'add-copyright' Raj
|\
| * de62fc3 adding line
| * 8746b9d Adding copyright notice
|/
* 218d0ee changes done to file
* cbb7ab4 commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
  big
* master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d big
Deleted branch big (was 7ffb2d1).

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git pull origin master
From https://github.com/rajkumargupta14/hello-world
 * branch            master     -> FETCH_HEAD
Already up to date.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git push origin master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 289 bytes | 144.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/rajkumargupta14/hello-world.git
   01e33a7..0199c9d  master -> master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$

Git Branching and Merging by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch mynewbranch

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -a
* master
  mynewbranch
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout mynewbranch
Switched to branch 'mynewbranch'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (mynewbranch)
$ git branch -a
  master
* mynewbranch
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (mynewbranch)
$ git log --oneline --decorate
cbb7ab4 (HEAD -> mynewbranch, origin/master, origin/HEAD, master) commit all
632f909 commit
8637d7a ignore
805a6ac Deleting new file
2678aa7 test
e144111 rename the file
5e8e01d Adding start test file
977ca2d Initial commit
34b2c44 updated file
0425ad1 update2
d8113f6 new line added
a29c62b modified index.jsp
a99e804 Update index.jsp
57a67c2 Update index.jsp
e18726d Update index.jsp
4a487a7 promotions comment
3a90027 Update index.jsp
f3ccb36 Update index.jsp
ad497a6 Update index.jsp
521d0fd modified index.jsp
73e663e modified index.jsp file for docker demo
691a7a2 modified index.jsp file
3e3afd8 Update Dockerfile
740736a Update Dockerfile
22e01c8 added docker file
1aa6466 Update index.jsp
5c693b0 latest code updated
7c81f41 Update index.jsp
4762ccd ansible added
9066612 new update
8127737 updated coc name
037bd4f updated index file
8d8c0b6 updated index file
5e95a23 Update index.jsp
a25d199 new update on index.html
438be18 Update README.md
3b7bdcd initial commit
2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (mynewbranch)
$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -m mynewbranch
fatal: A branch named 'mynewbranch' already exists.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -m mynewbranch newbranch

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -a
* master
  newbranch
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d newbranch
Deleted branch newbranch (was cbb7ab4).

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout -b title-change
Switched to a new branch 'title-change'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ git status
On branch title-change
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ git status
On branch title-change
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ git commit -am "changes done to file"
[title-change 218d0ee] changes done to file
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ git status
On branch title-change
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ git log --oneline
218d0ee (HEAD -> title-change) changes done to file
cbb7ab4 (origin/master, origin/HEAD, master) commit all
632f909 commit
8637d7a ignore
805a6ac Deleting new file
2678aa7 test
e144111 rename the file
5e8e01d Adding start test file
977ca2d Initial commit
34b2c44 updated file
0425ad1 update2
d8113f6 new line added
a29c62b modified index.jsp
a99e804 Update index.jsp
57a67c2 Update index.jsp
e18726d Update index.jsp
4a487a7 promotions comment
3a90027 Update index.jsp
f3ccb36 Update index.jsp
ad497a6 Update index.jsp
521d0fd modified index.jsp
73e663e modified index.jsp file for docker demo
691a7a2 modified index.jsp file
3e3afd8 Update Dockerfile
740736a Update Dockerfile
22e01c8 added docker file
1aa6466 Update index.jsp
5c693b0 latest code updated
7c81f41 Update index.jsp
4762ccd ansible added
9066612 new update
8127737 updated coc name
037bd4f updated index file
8d8c0b6 updated index file
5e95a23 Update index.jsp
a25d199 new update on index.html
438be18 Update README.md
3b7bdcd initial commit
2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (title-change)
$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff master title-change
diff --git a/start2.txt b/start2.txt
index 52d986d..1fb25fb 100644
--- a/start2.txt
+++ b/start2.txt
@@ -1 +1 @@
-qThis is Git Quick Start demo
+This is Git Quick Start demo

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool master title-change

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git merge title-change
Updating cbb7ab4..218d0ee
Fast-forward
 start2.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool master title-change

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff master title-change

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --graph --decorate
* 218d0ee (HEAD -> master, title-change) changes done to file
* cbb7ab4 (origin/master, origin/HEAD) commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html
* 438be18 Update README.md
* 3b7bdcd initial commit
* 2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master
  title-change

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d title-change
Deleted branch title-change (was 218d0ee).

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --graph --decorate
* 218d0ee (HEAD -> master) changes done to file
* cbb7ab4 (origin/master, origin/HEAD) commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html
* 438be18 Update README.md
* 3b7bdcd initial commit
* 2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout -b add-copyright
Switched to a new branch 'add-copyright'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git branch
* add-copyright
  master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git status
On branch add-copyright
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git commit -am "Adding copyright notice"
[add-copyright 8746b9d] Adding copyright notice
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git status
On branch add-copyright
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git status
On branch add-copyright
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git commit -am "adding line"
[add-copyright de62fc3] adding line
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git status
On branch add-copyright
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (add-copyright)
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git merge add-copyright --no-off
error: unknown option `no-off'
usage: git merge [<options>] [<commit>...]
   or: git merge --abort
   or: git merge --continue

    -n                    do not show a diffstat at the end of the merge
    --stat                show a diffstat at the end of the merge
    --summary             (synonym to --stat)
    --log[=<n>]           add (at most <n>) entries from shortlog to merge commit message
    --squash              create a single commit instead of doing a merge
    --commit              perform a commit if the merge succeeds (default)
    -e, --edit            edit message before committing
    --cleanup <mode>      how to strip spaces and #comments from message
    --ff                  allow fast-forward (default)
    --ff-only             abort if fast-forward is not possible
    --rerere-autoupdate   update the index with reused conflict resolution if possible
    --verify-signatures   verify that the named commit has a valid GPG signature
    -s, --strategy <strategy>
                          merge strategy to use
    -X, --strategy-option <option=value>
                          option for selected merge strategy
    -m, --message <message>
                          merge commit message (for a non-fast-forward merge)
    -F, --file <path>     read message from file
    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --abort               abort the current in-progress merge
    --quit                --abort but leave index and working tree alone
    --continue            continue the current in-progress merge
    --allow-unrelated-histories
                          allow merging unrelated histories
    --progress            force progress reporting
    -S, --gpg-sign[=<key-id>]
                          GPG sign commit
    --overwrite-ignore    update ignored files (default)
    --signoff             add Signed-off-by:
    --verify              verify commit-msg hook


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git merge add-copyright --no-ff
Merge made by the 'recursive' strategy.
 README.md  | 2 +-
 start2.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d add-copyright
Deleted branch add-copyright (was de62fc3).

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout -b simple-changes
Switched to a new branch 'simple-changes'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (simple-changes)
$ ll
total 12
-rw-r--r-- 1 Administrator 197121  133 Aug 29 07:52 Dockerfile
-rw-r--r-- 1 Administrator 197121 5969 Aug 29 07:52 pom.xml
-rw-r--r-- 1 Administrator 197121    4 Aug 29 09:40 ramu.yyy
-rw-r--r-- 1 Administrator 197121   54 Sep  3 10:41 README.md
drwxr-xr-x 1 Administrator 197121    0 Aug 29 07:52 server/
-rw-r--r-- 1 Administrator 197121   30 Sep  3 10:41 start2.txt
drwxr-xr-x 1 Administrator 197121    0 Aug 29 07:52 webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (simple-changes)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (simple-changes)
$ git status
On branch simple-changes
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (simple-changes)
$ git commit -am "adding"
[simple-changes 7fffcc8] adding
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (simple-changes)
$ git status
On branch simple-changes
nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (simple-changes)
$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -am "adding"
[master 7277340] adding
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 5 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --graph --decorate --all
* 7277340 (HEAD -> master) adding
| * 7fffcc8 (simple-changes) adding
|/
*   39c29d9 Merge branch 'add-copyright' Raj
|\
| * de62fc3 adding line
| * 8746b9d Adding copyright notice
|/
* 218d0ee changes done to file
* cbb7ab4 (origin/master, origin/HEAD) commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html
* 438be18 Update README.md
* 3b7bdcd initial commit
* 2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch
* master
  simple-changes

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git merge simple-changes -m "Merging changes from simple-changes brance"
Merge made by the 'recursive' strategy.
 start2.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --graph --decorate --all
*   9fc9b59 (HEAD -> master) Merging changes from simple-changes brance
|\
| * 7fffcc8 (simple-changes) adding
* | 7277340 adding
|/
*   39c29d9 Merge branch 'add-copyright' Raj
|\
| * de62fc3 adding line
| * 8746b9d Adding copyright notice
|/
* 218d0ee changes done to file
* cbb7ab4 (origin/master, origin/HEAD) commit all
* 632f909 commit
* 8637d7a ignore
* 805a6ac Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html
* 438be18 Update README.md
* 3b7bdcd initial commit
* 2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git branch -d simple-changes
Deleted branch simple-changes (was 7fffcc8).

Tuesday, 3 September 2019

Git Repository setup for comparing by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ ls
'3D Objects'/         Desktop/    'Local Settings'@   ntuser.dat.LOG1                                                                                ntuser.ini  'Saved Games'/   Videos/
 AppData/             Documents/   Music/             ntuser.dat.LOG2                                                                                Pictures/    Searches/
'Application Data'@   Downloads/  'My Documents'@     NTUSER.DAT{a057f24c-e827-11e8-81c0-0a917f905606}.TM.blf                                        PrintHood@   SendTo@
 Contacts/            Favorites/   NetHood@           NTUSER.DAT{a057f24c-e827-11e8-81c0-0a917f905606}.TMContainer00000000000000000001.regtrans-ms   projects/   'Start Menu'@
 Cookies@             Links/       NTUSER.DAT         NTUSER.DAT{a057f24c-e827-11e8-81c0-0a917f905606}.TMContainer00000000000000000002.regtrans-ms   Recent@      Templates@

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ cd projects/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects
$ ls
hello-world/  starter-web/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects
$ cd hello-world/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ cat README.md
# maven-project

Simple Maven Project

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git add README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git stats
git: 'stats' is not a git command. See 'git --help'.

The most similar command is
        status

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit README.md -m "commit"
[master 632f909] commit
 1 file changed, 1 insertion(+)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git add README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff
diff --git a/README.md b/README.md
index 69e4c7b..e8b0c6f 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
 # maven-project

 Simple Maven Project
-Raj Kumar Gupta
+Raj Kumar Gupta1

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool
q
      0 [sig] bash 2041! sigpacket::process: Suppressing signal 18 to win32 process (pid 4884)
      1 [sig] sh 2069! sigpacket::process: Suppressing signal 18 to win32 process (pid 2472)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ q
bash: q: command not found

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff HEAD
diff --git a/README.md b/README.md
index 894ea86..e8b0c6f 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
 # maven-project

 Simple Maven Project
-Raj Gupta
+Raj Kumar Gupta1

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool HEAD

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff --staged HEAD
diff --git a/README.md b/README.md
index 894ea86..69e4c7b 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
 # maven-project

 Simple Maven Project
-Raj Gupta
+Raj Kumar Gupta

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool --staged HEAD

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi

[1]+  Stopped                 vi

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md
        modified:   start2.txt


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff
diff --git a/README.md b/README.md
index 69e4c7b..e8b0c6f 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
 # maven-project

 Simple Maven Project
-Raj Kumar Gupta
+Raj Kumar Gupta1
diff --git a/start2.txt b/start2.txt
index 1fb25fb..52d986d 100644
--- a/start2.txt
+++ b/start2.txt
@@ -1 +1 @@
-This is Git Quick Start demo
+qThis is Git Quick Start demo

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff -- start2.txt
diff --git a/start2.txt b/start2.txt
index 1fb25fb..52d986d 100644
--- a/start2.txt
+++ b/start2.txt
@@ -1 +1 @@
-This is Git Quick Start demo
+qThis is Git Quick Start demo

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool -- start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline
632f909 (HEAD -> master) commit
8637d7a (origin/master, origin/HEAD) ignore
805a6ac Deleting new file
2678aa7 test
e144111 rename the file
5e8e01d Adding start test file
977ca2d Initial commit
34b2c44 updated file
0425ad1 update2
d8113f6 new line added
a29c62b modified index.jsp
a99e804 Update index.jsp
57a67c2 Update index.jsp
e18726d Update index.jsp
4a487a7 promotions comment
3a90027 Update index.jsp
f3ccb36 Update index.jsp
ad497a6 Update index.jsp
521d0fd modified index.jsp
73e663e modified index.jsp file for docker demo
691a7a2 modified index.jsp file
3e3afd8 Update Dockerfile
740736a Update Dockerfile
22e01c8 added docker file
1aa6466 Update index.jsp
5c693b0 latest code updated
7c81f41 Update index.jsp
4762ccd ansible added
9066612 new update
8127737 updated coc name
037bd4f updated index file
8d8c0b6 updated index file
5e95a23 Update index.jsp
a25d199 new update on index.html
438be18 Update README.md
3b7bdcd initial commit
2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff e18726d HEAD
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..7766a92
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.yyy
diff --git a/README.md b/README.md
index 8196d20..894ea86 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
 # maven-project

 Simple Maven Project
+Raj Gupta
diff --git a/start2.txt b/start2.txt
new file mode 100644
index 0000000..1fb25fb
--- /dev/null
+++ b/start2.txt
@@ -0,0 +1 @@
+This is Git Quick Start demo
diff --git a/webapp/src/main/webapp/index.jsp b/webapp/src/main/webapp/index.jsp
index 6c4841b..2bbeedf 100644
--- a/webapp/src/main/webapp/index.jsp
+++ b/webapp/src/main/webapp/index.jsp
@@ -1,7 +1,2 @@
-<h1> Hello, Welcome to Valaxy Technologies !! </h1>
-<h2> AWS & DevOps training </h2>
-<h2> Happy learning </h2>
-<h2> Contact us on +91-9642-858583 </h2>
-<h2> Please subscribe to Valaxy Technologes Channel </h2>
-<h2> thanks for following us </h2>
-<h2> we accept donations </h2>
+<h1> Hello, Welcome to Valaxy Technologies !!! </h1>
+<h1> Raj Kumar Gupta 1234 </h1>

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff HEAD HEAD^
diff --git a/README.md b/README.md
index 894ea86..8196d20 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
 # maven-project

 Simple Maven Project
-Raj Gupta

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool HEAD HEAD^

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline
632f909 (HEAD -> master) commit
8637d7a (origin/master, origin/HEAD) ignore
805a6ac Deleting new file
2678aa7 test
e144111 rename the file
5e8e01d Adding start test file
977ca2d Initial commit
34b2c44 updated file
0425ad1 update2
d8113f6 new line added
a29c62b modified index.jsp
a99e804 Update index.jsp
57a67c2 Update index.jsp
e18726d Update index.jsp
4a487a7 promotions comment
3a90027 Update index.jsp
f3ccb36 Update index.jsp
ad497a6 Update index.jsp
521d0fd modified index.jsp
73e663e modified index.jsp file for docker demo
691a7a2 modified index.jsp file
3e3afd8 Update Dockerfile
740736a Update Dockerfile
22e01c8 added docker file
1aa6466 Update index.jsp
5c693b0 latest code updated
7c81f41 Update index.jsp
4762ccd ansible added
9066612 new update
8127737 updated coc name
037bd4f updated index file
8d8c0b6 updated index file
5e95a23 Update index.jsp
a25d199 new update on index.html
438be18 Update README.md
3b7bdcd initial commit
2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff 57a67c2 740736a
diff --git a/Dockerfile b/Dockerfile
index 70c73fe..b3eca31 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,3 +4,4 @@ From tomcat:8-jre8
 # Maintainer
 MAINTAINER "valaxytech@gmail.com"
 COPY ./webapp.war /usr/local/tomcat/webapps
+EXPOSE 80
diff --git a/webapp/src/main/webapp/index.jsp b/webapp/src/main/webapp/index.jsp
index 015c17f..2cf3666 100644
--- a/webapp/src/main/webapp/index.jsp
+++ b/webapp/src/main/webapp/index.jsp
@@ -1,6 +1,3 @@
 <h1> Hello, Welcome to Valaxy Technologies !! </h1>
-<h2> AWS & DevOps training </h2>
-<h2> Happy learning </h2>
-<h2> Contact us on +91-9642-858583 </h2>
-<h2> Please subscribe to Valaxy Technologes Channel </h2>
-<h2> thanks for following us </h2>
+
+Deployment is going to happen through ansible

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool 57a67c2 740736a

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git diff master origin/master
diff --git a/README.md b/README.md
index 894ea86..8196d20 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
 # maven-project

 Simple Maven Project
-Raj Gupta

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git difftool master origin/master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   README.md
        modified:   start2.txt


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git add .

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   README.md
        modified:   start2.txt


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -m "commit all"
[master cbb7ab4] commit all
 2 files changed, 2 insertions(+), 2 deletions(-)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git pull
Already up to date.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git push origin master
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (7/7), 633 bytes | 158.00 KiB/s, done.
Total 7 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 1 local object.
To https://github.com/rajkumargupta14/hello-world.git
   8637d7a..cbb7ab4  master -> master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$

Friday, 30 August 2019

How to install P4Merge by Raj Gupta

Download and install it after that add the path(C:\Program Files\Perforce) to environment variable so that it can accessible from any where

https://www.perforce.com/downloads/visual-merge-tool


After setting path in environment variable when you give below command then it will open p4Merge


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ p4merge





Now do the below configuration to use with git

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ git config --global merge.tool p4merge

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ git config --global mergetool.p4merge.path "C:/Program Files/Perforce/p4merge.exe"

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ git config --global mergetool.prompt false

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ git config --global diff.tool p4merge

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ git config --global difftool.p4merge.path "C:/Program Files/Perforce/p4merge.exe"

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ $ git config --global difftool.prompt false
bash: $: command not found

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ git config --global difftool.prompt false

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~
$ git config --global --list
user.name=Raj Gupta
user.email=rajkumargupta14@gmail.com
alias.hist=log --all --graph --decorate --oneline
merge.tool=p4merge
mergetool.p4merge.path=C:/Program Files/Perforce/p4merge.exe
mergetool.prompt=false
diff.tool=p4merge
difftool.p4merge.path=C:/Program Files/Perforce/p4merge.exe
difftool.prompt=false



Thursday, 29 August 2019

Cleanup and Back to Origin(GitHub) by Raj Gupta

After all changes we need to push the code to github

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git pull origin master
From https://github.com/rajkumargupta14/hello-world
 * branch            master     -> FETCH_HEAD
Already up to date.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git push origin master
Enumerating objects: 10, done.
Counting objects: 100% (10/10), done.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (9/9), 841 bytes | 210.00 KiB/s, done.
Total 9 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 1 local object.
To https://github.com/rajkumargupta14/hello-world.git
   5e8e01d..8637d7a  master -> master

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)

Ignoring Unwanted files and folders in Git by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls -al
total 19
drwxr-xr-x 1 Administrator 197121    0 Aug 29 08:35 ./
drwxr-xr-x 1 Administrator 197121    0 Aug 29 07:52 ../
drwxr-xr-x 1 Administrator 197121    0 Aug 29 08:35 .git/
-rw-r--r-- 1 Administrator 197121  133 Aug 29 07:52 Dockerfile
-rw-r--r-- 1 Administrator 197121 5969 Aug 29 07:52 pom.xml
-rw-r--r-- 1 Administrator 197121   38 Aug 29 07:52 README.md
drwxr-xr-x 1 Administrator 197121    0 Aug 29 07:52 server/
-rw-r--r-- 1 Administrator 197121   29 Aug 29 08:35 start2.txt
drwxr-xr-x 1 Administrator 197121    0 Aug 29 07:52 webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi ramu.yyy

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  ramu.yyy  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        ramu.yyy

nothing added to commit but untracked files present (use "git add" to track)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi .gitignore

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ cat .gitignore
*.yyy

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .gitignore

nothing added to commit but untracked files present (use "git add" to track)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git add .gitignore

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   .gitignore


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit .gitignore -m "ignore"
[master 8637d7a] ignore
 1 file changed, 1 insertion(+)
 create mode 100644 .gitignore

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 4 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$

Git Alias by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --all --graph --decorate --oneline
* 805a6ac (HEAD -> master) Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d (origin/master, origin/HEAD) Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html
* 438be18 Update README.md
* 3b7bdcd initial commit
* 2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git hist
git: 'hist' is not a git command. See 'git --help'.

The most similar command is
        bisect

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git config --global alias.hist "log --all --graph --decorate --oneline"

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git hist
* 805a6ac (HEAD -> master) Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d (origin/master, origin/HEAD) Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html
* 438be18 Update README.md
* 3b7bdcd initial commit
* 2047f57 Create README.md

This alias are saved in below file

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi ~/.gitconfig


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$

How to check history of Git by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git logs
git: 'logs' is not a git command. See 'git --help'.

The most similar command is
        log

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log
commit 805a6ac80a64923150a702334fc6260e3dad38ac (HEAD -> master)
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:29:28 2019 +0000

    Deleting new file

commit 2678aa7022d33d2d65f6a9c115ed02fea09ddcaa
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:27:50 2019 +0000

    test

commit e14411148b83b15aab594e9f6bd005b868718d8a
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:01:25 2019 +0000

    rename the file

commit 5e8e01d997b76ef16b68db043099f7a99c151dbe (origin/master, origin/HEAD)
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Fri Aug 23 11:27:00 2019 +0000

    Adding start test file

commit 977ca2dfcdb467fc73e69d8b18b9aafb39347d34
Author: rajkumargupta14 <37054671+rajkumargupta14@users.noreply.github.com>
Date:   Wed Jan 30 14:42:16 2019 +0530

    Initial commit

commit 34b2c4436021da9763d7eb891e76d5520ca444dd
Author: rajkumargupta14 <37054671+rajkumargupta14@users.noreply.github.com>
Date:   Fri Jan 25 15:37:24 2019 +0530

    updated file

commit 0425ad19e580b745d554a8f281fb5aadc5ebda55
Author: rajkumargupta14 <37054671+rajkumargupta14@users.noreply.github.com>
Date:   Mon Jan 14 20:07:27 2019 +0530

    update2

commit d8113f638d0b2aa813d93a7db3b3c28a3d2fe1e3
Author: root <root@ip-172-31-22-126.ap-southeast-1.compute.internal>
Date:   Tue Dec 25 06:47:49 2018 +0000

    new line added

commit a29c62b0253122f7e43e05d6af77af08c076f02c

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --abbrev-commit
commit 805a6ac (HEAD -> master)
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:29:28 2019 +0000

    Deleting new file

commit 2678aa7
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:27:50 2019 +0000

    test

commit e144111
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:01:25 2019 +0000

    rename the file

commit 5e8e01d (origin/master, origin/HEAD)
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Fri Aug 23 11:27:00 2019 +0000

    Adding start test file

commit 977ca2d
Author: rajkumargupta14 <37054671+rajkumargupta14@users.noreply.github.com>
Date:   Wed Jan 30 14:42:16 2019 +0530

    Initial commit

commit 34b2c44
Author: rajkumargupta14 <37054671+rajkumargupta14@users.noreply.github.com>
Date:   Fri Jan 25 15:37:24 2019 +0530

    updated file

commit 0425ad1
Author: rajkumargupta14 <37054671+rajkumargupta14@users.noreply.github.com>
Date:   Mon Jan 14 20:07:27 2019 +0530

    update2

commit d8113f6
Author: root <root@ip-172-31-22-126.ap-southeast-1.compute.internal>
Date:   Tue Dec 25 06:47:49 2018 +0000

    new line added

commit a29c62b

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --oneline --graph --decorate
* 805a6ac (HEAD -> master) Deleting new file
* 2678aa7 test
* e144111 rename the file
* 5e8e01d (origin/master, origin/HEAD) Adding start test file
* 977ca2d Initial commit
* 34b2c44 updated file
* 0425ad1 update2
* d8113f6 new line added
* a29c62b modified index.jsp
* a99e804 Update index.jsp
* 57a67c2 Update index.jsp
* e18726d Update index.jsp
* 4a487a7 promotions comment
* 3a90027 Update index.jsp
* f3ccb36 Update index.jsp
* ad497a6 Update index.jsp
* 521d0fd modified index.jsp
* 73e663e modified index.jsp file for docker demo
* 691a7a2 modified index.jsp file
* 3e3afd8 Update Dockerfile
* 740736a Update Dockerfile
* 22e01c8 added docker file
* 1aa6466 Update index.jsp
* 5c693b0 latest code updated
* 7c81f41 Update index.jsp
* 4762ccd ansible added
* 9066612 new update
* 8127737 updated coc name
* 037bd4f updated index file
* 8d8c0b6 updated index file
* 5e95a23 Update index.jsp
* a25d199 new update on index.html
* 438be18 Update README.md
* 3b7bdcd initial commit
* 2047f57 Create README.md

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log 805a6ac...e144111
commit 805a6ac80a64923150a702334fc6260e3dad38ac (HEAD -> master)
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:29:28 2019 +0000

    Deleting new file

commit 2678aa7022d33d2d65f6a9c115ed02fea09ddcaa
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:27:50 2019 +0000

    test

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log --since="3 days ago"
commit 805a6ac80a64923150a702334fc6260e3dad38ac (HEAD -> master)
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:29:28 2019 +0000

    Deleting new file

commit 2678aa7022d33d2d65f6a9c115ed02fea09ddcaa
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:27:50 2019 +0000

    test

commit e14411148b83b15aab594e9f6bd005b868718d8a
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:01:25 2019 +0000

    rename the file

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git log -- start2.txt
commit e14411148b83b15aab594e9f6bd005b868718d8a
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:01:25 2019 +0000

    rename the file

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git show 2678aa7022d33d2d65f6a9c115ed02fea09ddcaa
commit 2678aa7022d33d2d65f6a9c115ed02fea09ddcaa
Author: Raj Gupta <rajkumargupta14@gmail.com>
Date:   Thu Aug 29 08:27:50 2019 +0000

    test

diff --git a/raj90.txt b/raj90.txt
new file mode 100644
index 0000000..876c72e
--- /dev/null
+++ b/raj90.txt
@@ -0,0 +1 @@
+This is test file.

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$

Deleting files in Git by Raj Gupta


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ vi raj90.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git ststus
git: 'ststus' is not a git command. See 'git --help'.

The most similar command is
        status

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        raj90.txt

nothing added to commit but untracked files present (use "git add" to track)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git add raj90.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   raj90.txt


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git rm raj90.txt
error: the following file has changes staged in the index:
    raj90.txt
(use --cached to keep the file, or -f to force removal)

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  raj90.txt  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   raj90.txt


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit raj90.txt -m "test"
[master 2678aa7] test
 1 file changed, 1 insertion(+)
 create mode 100644 raj90.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git rm raj90.txt
rm 'raj90.txt'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    raj90.txt


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git commit -m "Deleting new file"
[master 805a6ac] Deleting new file
 1 file changed, 1 deletion(-)
 delete mode 100644 raj90.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git rm stsrt2.txt
fatal: pathspec 'stsrt2.txt' did not match any files

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git rm start2.txt
rm 'start2.txt'

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    start2.txt


Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  README.md  server/  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git reset HEAD start2.txt
Unstaged changes after reset:
D       start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  README.md  server/  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    start2.txt

no changes added to commit (use "git add" and/or "git commit -a")

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git checkout -- start2.txt

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ ls
Dockerfile  pom.xml  README.md  server/  start2.txt  webapp/

Administrator@EC2AMAZ-8EUJ4RB MINGW64 ~/projects/hello-world (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Adm