git config --list # provides you the configuration for the Git.
git init # tells git to track current folder and all its sub-folder.
git status # gives you the status of the repository that you are in.
git add # adds the file to the staging area
git commit # commits the file to the repo
git log # gives you the details of everything happened in that repo
git log --oneline # gives you oneline version of the same.
git commit -m "comment" # allows you to commit without going in to the file.
git diff # gives you the difference between last commit.
git diff --staged # gives you the staged file and your last commit
git diff HEAD~1 # Gives you the difference between current state and previous state of the committed file, similarly HEAD~2 will provide you the difference between CurrentState and 2 states before.
glit log --oneline gives you the hashcode of all the diffs and you can use that to do the diff with that particular commit.
git checkout HEAD~1 # Checks out a file with the earlier version than the current version.
git reset --hard # resets Git to the last known status.
git reset HEAD # resets the changes back from staging area for that particular file.
When you create a new folder/directory in Git repository, then Git doesn't recognize it and you have to add a readme file in each of the folder for Git to recognize it.
git stash # is similar to creating a shevleset in Visual Studio
git branch # Creates a branch and copies all the files from the master branch
git checkout # Points Git to new branch location.
git checkout master # switches back to the master branch
git checkout . # will undo your local changes.
git init # tells git to track current folder and all its sub-folder.
git status # gives you the status of the repository that you are in.
git add
git commit # commits the file to the repo
git log # gives you the details of everything happened in that repo
git log --oneline # gives you oneline version of the same.
git commit -m "comment" # allows you to commit without going in to the file.
git diff # gives you the difference between last commit.
git diff --staged # gives you the staged file and your last commit
git diff HEAD~1 # Gives you the difference between current state and previous state of the committed file, similarly HEAD~2 will provide you the difference between CurrentState and 2 states before.
glit log --oneline gives you the hashcode of all the diffs and you can use that to do the diff with that particular commit.
git checkout HEAD~1
