GIT tips and trick

gregoire barret
Cover Image for GIT tips and trick

Git can be hard to master. As i mostly use it by command line, I not really use any GUI expect the one integrated with my IDE, I will list the different trick I use time to time. I write them down here so it's will be easiest to myself to find them later.

Revert local branch

This command revert the branch to the remote branch, an discard all local commits.

$ git reset --hard origin/<branch_name>

Display change on a file

This commend display the change of a specific file

$ git show <file>