1

How can I init environment variables while run "git clone" from a remote repo ?

Is there an option that when I clone the remote repo I can run a startup file which will init some environment variables?

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
user2321876
  • 105
  • 1
  • 7

1 Answers1

0

Not really with git alone.

You might try a post-checkout hook, set up through a git template folder: see "git hooks : is there a clone hook?".
But that is really tricky, and remains a local per-user solution.

You could consider a wrapper to the git command, which would, in case of a clone, export or set environment variables (again a local solution, not one associated with the repo you are cloning).

Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755