DEV Community

taijidude
taijidude

Posted on • Updated on

Git Commands from outside the repository

This week i discovered something nice and really obvious if you think about it for a minute. But it never really dawned on me till now.

With the parameter -C you can pass git the directory it's supposed to work on. This is great if you use git scripts a lot. No more navigation to the right folder, just pass the absolute path via -C and this should clean up the script nice and reduce the potential for error a lot.

Just have a look at the documentation for the git command.

git help git
Enter fullscreen mode Exit fullscreen mode

Alt Text

Top comments (0)