git commands
git commands
global settings
get all global settings
the settings will be read from <home directory>/.gitconfig
basic operations
initialize the git repository
statuses
??
the file is untracked file
the file is not yet tracked
untracked: the file is not present (there is no version of it created yet) in the .git
directory
A
A -> Add to the repository
this will appear only for those file which were not yet tracked (new files)
the file is added to the commit area
once the changes are committed, the new version of this file will get created
[ M]
M -> modified
this status will appear only for those files which have been already tracked
the file is changes since the last commit
the file is not yet added to the commit area
[M ]
M -> modified
this status will appear only for those files which have been already tracked
the file is added to the commit area and ready to create a new version
add a file to commit (logical) area
# show the differences for every file since the last committed version
> git diff
stash commands
these commands are used to move to stash area (logical area)
move the changes to stash area
get the specific version from stash keeping the changes in the stash area
get the last version by keeping the changes in the stash area
get the specific version from stash removing the changes in the stash area
get the last version by removing the changes in the stash area
the pop works with last in first out strategy
hard reset: get the latest versions of every file and replace with the current versions
used to discard the changes after moving to the staging area
git reset --hard = git reset + git checkout
git branching
get the list of branches
delete a branch