git TutorialIntroduction Installing Git Understanding Git architecture Initializing the new Git respository Cloning new Git repository .git directory in Git repository Viewing Git configuration First time Git configuration Using SSH keys with Git Checking Git status Adding files into staging area in Git Committing changes to the local repository Ignoring files using .gitignore Viewing the history of commits Viewing the file contents in working directory, staging area and repository Viewing difference between files Viewing the history of files Git revert Git Reset git reflog Creating and switching to new branches in Git Viewing existing branches Merging branches Resolving conflicts Rebase Deleting branches Renaming the branch in Git Push Pull Stashing the changes in Git Tags in Git Patches in Git Creating new repository on GitHub Pushing local repository to remote repository like GitHub IntelliJ IDEA
Viewing difference between files in gitgit diff command can be used to view the difference between files in Git.
- git diff : shows the difference between working directory and staging area
- git diff –cached : shows the difference between staging area and HEAD (last commit)
- git diff HEAD : shows the difference between working directory and HEAD (last commit)
- git diff HEAD^1 : shows the difference between working directory and HEAD (second last commit)
- git diff –name-only :shows only the list of files that have changed in working directory since last commit
- gitk f1.txt : shows the difference in GUI
Below image shows how gitk tool looks like.
Web development and Automation testing