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,262,500
  • 529
  • 4,410
  • 5,250
user2321876
  • 105
  • 1
  • 8

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,262,500
  • 529
  • 4,410
  • 5,250