DEV Community

taijidude
taijidude

Posted on • Edited on

3

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Retry later