I
I
Ivan Fedorov2016-06-01 11:41:47
git
Ivan Fedorov, 2016-06-01 11:41:47

How to create a script in Git bash for Windows?

Is it possible to script for bash in windows? For example, I need to create multiple repositories, how to do not write for each git init, git add ., git commit -m "bla-bla-bla". Google doesn't say much about it. Don't kick me too hard, I just took up Git, but I don't want to switch to Linux, there are too few programs that I'm used to using in Windows.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Анатолий Медведев, 2016-06-01
@Nikstorma

Под рукой нет винды но думаю должно получиться, ну или babun поставить лучше(или ждать обновления 10ки со встроенной поддержкой командной оболочки). А батники это от лукавого.

#!/bin/bash

for i in "[email protected]"
do
    mkdir ${i}
    cd ${i}
    git init
    echo "README.md of repository ${i}" > README.md
    git add .
    git commit -m "initial commit"
    cd ..
done

41b56c92716e4c8c8f58a55df180ea51.png

G
GavriKos, 2016-06-01
@GavriKos

Так а зачем для этого Git bash? Используйте обычный bat файл.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question