0

I am really new to batch file scripting, I managed to clone the repo I wanted (I think) but I am not sure how to set the save directory. I already saw this SO post How do I execute several git commands in a batch file without terminating after the first command? but I'm afraid that didn't answer my question. Here is what I have so far:

pullrepo.bat:

start "" "C:\Program Files (x86)\Git\bin\git.exe" clone git@bitbucket.org:BLAHBLAHBLAH.git
pause

When I look at the bat script (and the git window) that shows up everything seems to work, but I cannot find the folder for the local copy of the repo (by searching for folder name), much less set the local save location as I would like to. Eventually my goal is to also add a push function that prompts the user for a commit message inside one of the windows (git or bat)

Community
  • 1
  • 1
Rilcon42
  • 9,584
  • 18
  • 83
  • 167

1 Answers1

0

The "save directory" is a subdirectory named after the name of the repository (BLAHBLAHBLAH) unless explicitly specified, in the current working directory (i.e. in C:\Documents and settings\ if I remember correctly MS Windows filesystem layout). You also may specify one extra parameter to git clone and that would be the name of the cloned repo' directory.

Also I would switch to Bash if you aren't stuck to CMD shell. Anyway Bash is supplied with Git for Windows, and it has much better and powerful scripting language to my taste. Also you may considr tig if you really like a console-based interactive git client :)

user3159253
  • 16,836
  • 3
  • 30
  • 56