3

I'm using Cygwin and have configured my git settings there(ssh keys, usernames, etc).

How can i make cywin's git callable from windows shell so it uses cygwin's bash and it's settings?

Kinda like git-for-windows does, i can call git from cmd.exe but it gets interpreted by it's bash console.

I know msysgit uses a batch file of sorts to make this possible, but i've not yet understood it..

Mainly i need to provide git to PHPStorm and Android Studio, and i'd like to keep my ssh and git config in one place (ssh usernames/keys, git settings).

EDIT / UPDATE: Having not found a solution for my needs i currently have resorted to having both Cygwin and Git for windows installed and set my Cygwin home directory to my windows profile directory. This resolves the problem of having multiple config files but...

Now there are two more problems:

  1. My cygwin installation is now in two directories, C:\cygwin64 and my windows user folder, which makes backup more complicated and is tied to my username (another user couldn't use it)
  2. I might make a change in config files which could break Git Bash (eg. in .bashrc)
Kristian
  • 3,283
  • 3
  • 28
  • 52
  • No need for cygwin for this: keep everything in %USERPROFILE%(\.ssh), and a regular git for windows will be more than enough. – VonC Jan 08 '16 at 14:20
  • That means duplicate configurigation files. So any edits must be done in both cygwin and windows user directory. Thats the thing i want to avoid – Kristian Jan 08 '16 at 14:22
  • Sorry, didn't read your comment perfectly.. I'm using cygwin anyway, thats why i want to do this. Or did you mean i can use windows git from cywin's bash without problems? – Kristian Jan 08 '16 at 14:27
  • You can use git for Windows and cygwin: if both refers to HOME at the same folder (usually %USERPROFILE%), they will look for the same config files at the same place. But why using Cygwin? git for windows has more than 200+ unix commands pre-compiled for Windows. – VonC Jan 08 '16 at 14:48
  • Except some of what i need, on the top of my head i can tell wget, i have a bunch of scripts using wget instead of curl and some of them i cannot even change.. Probably i'll find more. Also cygwin plays a lot better with my editor terminal integration – Kristian Jan 13 '16 at 09:37

1 Answers1

0

How can i make cywin's git callable from windows shell so it uses cygwin's bash and it's settings?

You don't need to use cywin's, use git bash instead which has all you will need.

Simply download and install git for windows from the official site.
As @VonC mentioned both git bash and git (cmd) are using the same home folder which is you Users/.

In this folder you should have the global .gitconfig & your .ssh folder with the ssh keys.

You can even create .bashrc in windows but it will be overkill since you should use the .gitconfig

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • See: http://stackoverflow.com/questions/34678806/run-git-from-windows-via-cygwin/34702269#comment57104713_34678806 – Kristian Jan 13 '16 at 09:38