1

I've saved the following as an .sh file and executed it from my root directory: https://gist.github.com/emiller/6769886

Got a couple of errors:

script.sh: line 65: conditional binary operator expected
script.sh: line 65: syntax error near `=~'
script.sh: line 65: `while [[ $1 =~ ^\- ]]; do'

And then when I ran the git-rewrite-history command I received an error:

'git-rewrite-history' is not recognized as an internal or external command,
operable program or batch file.

Would appreciate help, 0 linux experience here.

Thanks.

Edit - I'm using bash from windows, which is probably related to the issue. Will attempt on a Linux distribution.

Yoni Mor
  • 354
  • 1
  • 2
  • 12

2 Answers2

1
'git-rewrite-history' is not recognized as an internal or external command,
 operable program or batch file.

You need to set the script execution permissions:

chmod 777 path/to/git-rewrite-history
CodeWizard
  • 128,036
  • 21
  • 144
  • 167
0

A bash script named git-rewrite-history (even on Windows) must be executed with:

git rewrite-history

Any script named git-xxx can be called that way (git xxx), as long as git-xxx is in a folder referenced by your %PATH% environment variable.
The bash script will be executed in the msys2 bash git session, even when called from a simple Windows CMD shell session.
You do not need Cygwin at all.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250