TFW you learn something that saves you a ton of time.
Our GitHub services team has on-demand content for learning Git, including a Git out of Trouble section. On page 2 git-set-up they show you how to create a script to create several files, commit them to your repo, one file at a time.
I’m using Git Bash, so here’s the Bash script
for d in {1..6};
do touch file$d.md;
git add file$d.md;
git commit -m "adding file $d";
done
First, you’ll want to do `git init` otherwise, you’ll get yelled at by your shell for not being in a git repository.
Just copy and paste that into your shell (terminal or whatever),
Press Enter,
and enjoy your Git out of Trouble explorations!
2 thoughts on “How to write a Bash or PowerShell script to quickly create test repos – 086”