if any conflict happened, it will show conflict, we have to do modification and commit again.

Delete a branch

git branch -d <brach name>

this will delete if all the changes are merged, if you want to use force delete , even not merged,

git branch -D <branch name>

Upload branch into server at setting head for push

git push --set-upstream origin <branch name>

Stash all local changes

git stash

Take back stashed changes – This will take aback all the changes you stashed

git stash pop

Discard changes on one file

git checkout filename

Remove local commit and reset to server head – it will delete all the local changes

git reset --hard origin/branch name

List all the branches push/pull remote origin.

This will show all the remote and local branches and where it is pointing into

git remote show origin

Fetch and push origin list

git remote -v

View uncommitted changes made

git diff

To see all the logs

git log

To see log with difference

git log -p

Git log for a single file

git log -p file/path
-p will give changes also

Other options with git log

git log --stat //this will show only number of files changed and number of changes
git log --pretty=oneline //show all the changes in one line with head and comment
git log --pretty=format:"%h - %an, %ar : %s" //show with name time and commit message
git log --author=username //show only one user commit