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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay