Executing git commands on a different directory

Executing git commands on a different directory

2017, Sep 30    

1. The Problem

So, you are on a specific directory, but would like to execute a git command on a different one. I don’t know whyl for me, it’s just only that I’m lazy.

2. The Solution

Here is your command’s format:

git -C [directory] [git_command]

And here is a screenshot to make things more clear:

Git command different dir

3. The Reference

For further reference, you can consult this StackOverflow thread.

Cheers!