Difference between revisions of "Git -C"

From wikieduonline
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
  
 
* Pull subdirectories:
 
* Pull subdirectories:
::<code>ls | [[parallel]] git -C {} [[git pull|pull]]</code> (assuming all sub-dirs are git repositories)<ref>https://stackoverflow.com/a/33557279</ref>
+
::<code>ls | [[parallel]] git -C {} [[git pull|pull]]</code> (assuming all sub-dirs are git repositories) <ref>https://stackoverflow.com/a/33557279</ref>
 
::<code>ls | parallel git -C {} fetch</code>
 
::<code>ls | parallel git -C {} fetch</code>
 
:: <code>-C <PATH></code> run as if git was started in <path> instead of the current working directory.
 
:: <code>-C <PATH></code> run as if git was started in <path> instead of the current working directory.
 +
 +
== Related ==
 +
* [[git pull]]
 +
  
  
 
== See also ==
 
== See also ==
 
* {{git pull}}
 
* {{git pull}}
 +
* {{git}}
  
 
[[Category:Git]]
 
[[Category:Git]]

Latest revision as of 08:55, 16 August 2024

git -C <path> run as if git was started in <path> instead of the current working directory.
  • Pull subdirectories:
ls | parallel git -C {} pull (assuming all sub-dirs are git repositories) [1]
ls | parallel git -C {} fetch
-C <PATH> run as if git was started in <path> instead of the current working directory.

Related[edit]


See also[edit]

  • https://stackoverflow.com/a/33557279
  • Advertising: