DEV Community

Serhat Teker
Serhat Teker

Posted on Originally published at tech.serhatteker.com on

Git Pull/Push From Another Directory

I wish I knew that earlier, it would save a lot of cd:

$ git -C /dir/you/want/to/pull/push push
# with verbose output
$ git -C /dir/you/want/to/pull/push push -v
💬 ชาวเน็ตแห่แชร์: serhatteker/git pull push from another directory b - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: serhatteker/git pull push from another directory b - ประเด็นร้อน

NOTICE:

-C flag needs git > 1.8.5

It means that with -C flag you can specify the directory you want to interact
with. I normally go into the directory than push:

$ cd /dir/you/want/to/pull/push && git pull # or push
💬 ชาวเน็ตแห่แชร์: serhatteker/git pull push from another directory b - ประเด็นร้อน 💬 ชาวเน็ตแห่แชร์: serhatteker/git pull push from another directory b - ประเด็นร้อน

Not anymore!

All done.


Reference:

Top comments (0)