1.

What is the function of ‘git diff ’ in git?

Answer»

'git diff ' dependably show the progressions between various submits, submit and working tree etc. Git has an INUIT Index between local repo and our working directory. So the vast majority of Git directions really allude to list or the local repo. When we state HEAD in our Git direction, it really alludes the local repo.

//contrast the working directory and local repo.

  • git diff HEAD [filename] 

//contrast the working directory and index.

  • git diff [filename] 

//contrast the index and local repo.

  • git diff - cached[filename] 

We can likewise look at records from two distinctive submits. Each submit in Git has a hash submit ID which we can get when we type git log. At that point, we can utilize the submit id with diff order this way.

  • git diff 8ez2..e13 922...a3f86

We can look at a solitary file, YET the entirety of our progressions WITHOUT a moment's delay. On the off chance that we have made changes in numerous files, simply don't make reference to any file name in the diff direction which will diff all the changed records.

//CONTRASTS working directory and index,

//for example, demonstrates the progressions that are not staged yet.

  • git diff 

//contrasts working catalog and local repo

//demonstrates the rundown of changes after your last submit.

  • git diff HEAD 

//contrasts index and local repo

//demonstrates the diff between your last submit and changes to be submitted straightaway.

  • git diff - cached


Discussion

No Comment Found