Git

How to check if a file is tracked and if not, then track it?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

There are different ways to check whether a file is tracked or not:

  • git ls-files -> exit code of 0 means it's tracked
  • git blame ...