Difference between revisions of "Git -C"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
  
  git -C <path>
+
  git -C <path> run as if git was started in <path> instead of the current working directory.
  
 
* Pull subdirectories:
 
* Pull subdirectories:
Line 7: Line 7:
 
::<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.
 
  
  

Revision as of 11:04, 11 February 2022

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.


See also

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