Git Commands
Git Commands
git status
Capgemini Public
--------------------to remove a file from staged changes------
git stash:
git has an area called stash where you can temporarily store a snapshot of your changes without
committing to the git repository.
* you made some changes but you don’t want to commit them and you want to switch to another
branch-------
GIT MERGE
when the local branch is behind the master branch , the branch needs the new changes which are in
master branch , then merge is used
Basically git merge creates a new commit with all the commits you made to the branch.
GIT REBASE:
when the local branch is behind the master branch , the branch needs the new changes which are in
master branch , then fetch is used
Basically git rebase does not create a new commit , all the commits will be shown in the new branch ,
so unnecessary history.
Capgemini Public
GIT FETCH:
When we do git fetch all the changes from the repository will be downloaded into the remote
directory/repository but not into local repository.
When we do git fetch all the changes from the repository will be downloaded into the remote
directory/repository and then from remote local repository.
Capgemini Public