I am on windows-10. I want to create a batch-file to automate:
- Starting Git Bash in project folder
Running the following Git commands:
eval $(ssh-agent -s) ssh-add ~/.ssh/github_rsa git remote add origin [email protected]:git_user_name/git_repository_name.git
My current batch file below successfully starts Git Bash in the project folder, but I have not found anything which helps me learn how to run the git commands.
@echo off
cd /d C:\project_folder
start "" "%PROGRAMFILES%\Git\bin\sh.exe" --login -i <== edited per suggestion
sh.exe -c "commands here". Don't use--loginor-iunless you're planning on typing the commands manually."%ProgramFiles%\Git\bin\sh.exe"would be more succinct, and no less robust.sh.exe -c "eval $(ssh-agent -s)". I did want to have those three commands run and then have git bash open so i could continue to use it manually eggit add .etc