Jump to content

Install Git on Windows?


Gazley
 Share

Recommended Posts

Hi there,

Just started using Windows 10 instead of my old iMac. I wondered what PW devs (on Windows) are using as their Git processor on Windows 10? I use PHPStorm for my Git handling stuff but it needs to find a git.exe file somewhere on my PC. There seem to be numerous different options, all with different pros/cons. Any consensus?

Cheers and thanks! :)

Link to comment
Share on other sites

Hi @abdus - many thanks for the heads-up on Chocolatey. Actually, I had already tried it and got a "WARNING: Not setting tab completion: Profile file does not exist at..." error. Otherwise, it looked really good but, I couldn't actually work out whether it was installed properly or not?

Link to comment
Share on other sites

Is the error permanent? Unless it gives red errors, I wouldn't worry.

If git is installed, you should be able to access it from command line. Once choco installs a program and adds it to PATH, it runs a bat file called refreshEnv.cmd to refresh the PATH variable. Close (all) command prompts and reopen, then try running git. 

Link to comment
Share on other sites

I'd suggest the full package of Laragon. Comes with the usual AMP stack and a bunch of utilities that mike life easy. If you're happy with your existing stack, then maybe use Scoop, which is like Homebrew for Windows. Either way, git will become available in your path and your IDE can use it.

I wrote a short post on Scoop some time back: https://blog.rockett.pw/post/scoop

  • Like 3
Link to comment
Share on other sites

@Mike Rockett - thanks for your advice. Scoop looks really good! I actually installed Laragon today and it appears to give me what I need. The terminal is nice and it even gave me Vim from the command line. Pretty sweet :)

Hey, @abdus - I tried installing again with no luck. I then added the missing profile and re-installed and all seemed OK until I entered Powershell. It just errored and then said something about the profile wasn't digitally signed. It said delete it or rename it. More crashing ensued and then, I gave up! It looks really good but, given the installation issues I've had, the juice isn't worth the squeeze.

  • Like 1
Link to comment
Share on other sites

16 minutes ago, Gazley said:

@Mike Rockett - thanks for your advice. Scoop looks really good! I actually installed Laragon today and it appears to give me what I need. The terminal is nice and it even gave me Vim from the command line. Pretty sweet :)

Glad it worked out for you. Laragon has replaced XAMPP and EasyPHP (in that order) as it's the only thing that works well for me. What's even better is one can add a "Quick Create" profile for ProcessWire, just by pointing to the latest ZIP release on GH.

 

pw-laragon.png

In the configuration option, add:

# ProcessWire
ProcessWire=https://github.com/processwire/processwire/archive/master.zip

Done!

  • Like 2
Link to comment
Share on other sites

@Mike Rockett - just to clarify, I have set up a project/folder called "angie". If I type "angie.dev" in the browser, I get the page in the attached image. If I just type localhost, I get what I need, the document root of the c:\laragon\www\angie folder. This is just fine, but, some of the documentation I've read suggests that you can type http://angie.dev/ and the page will load. Obviously, I'm not seeing this. Any thoughts?

Cheers.

laragon_angie.PNG

Link to comment
Share on other sites

21 minutes ago, Gazley said:

@Mike Rockett - just to clarify, I have set up a project/folder called "angie". If I type "angie.dev" in the browser, I get the page in the attached image. If I just type localhost, I get what I need, the document root of the c:\laragon\www\angie folder. This is just fine, but, some of the documentation I've read suggests that you can type http://angie.dev/ and the page will load. Obviously, I'm not seeing this. Any thoughts?

Cheers.

I've faced the same issue, and landed up changing the domain extension to .local instead of .dev due to the ICANN name collision. It's been working like a dream so far. Note that, if you do this, you will need to manually edit your hosts file, as well as your Apache vhosts (shortcuts to all of these are available in the system tray menu) for existing sites.

  • Like 1
Link to comment
Share on other sites

Hey @Mike Rockett - had some fun last night trying to edit the hosts file on Windows 10. Lots of Googled threads on issues surrounding this none of which worked. After lots of messing around, I finally discovered that the antivirus program on the machine had locked the file in a process (for security reasons). Deep in its configuration, I found a setting to release the hosts file. When I did that, I was then able to add the angie.local reference. When I looked again, I also discovered that Laragon has added the same line into hosts with a comment "some Laragon magic!" :)

So, it seems that Laragon will update hosts as long as it's writable.

Thanks for your help with this Mike - I appreciate it :)

Link to comment
Share on other sites

3 hours ago, Gazley said:

Hey @Mike Rockett - had some fun last night trying to edit the hosts file on Windows 10. Lots of Googled threads on issues surrounding this none of which worked. After lots of messing around, I finally discovered that the antivirus program on the machine had locked the file in a process (for security reasons). Deep in its configuration, I found a setting to release the hosts file. When I did that, I was then able to add the angie.local reference. When I looked again, I also discovered that Laragon has added the same line into hosts with a comment "some Laragon magic!" :)

So, it seems that Laragon will update hosts as long as it's writable.

Thanks for your help with this Mike - I appreciate it :)

In normal situations, apps that run as the administrator can write to the hosts file. Sometimes, Antivirus does this nonsense of locking the file, and then they don't provide a simple option to unlock the file for writing.

Glad it's all working now. :)

  • Like 1
Link to comment
Share on other sites

W7 and newer have extra protections on certain stuff.  Just being an administrator user on your windows is really a "mostly" administrator user, but to edit hosts (and other protected system files) you need to explicitly tick "run as administrator" in the program you're using to access the file.  For me, I created a desktop shortcut ot file explorer, in the shortcut properties tick "run as administrator" after navigating to hosts file open it with notepad from within file explorer.

FWIW, being linux-oriented and using both windows and linux to edit websites, on w10 I installed xampp,  cygwin for ssh server on win, geany (which is available on both win and linux), and git for windows  https://git-scm.com/download/win

I don't use github though, I use git for my own private git repository I set up running on a Digital Ocean CentOS droplet.

I live pretty much in the command line, and this setup allows me to use pretty much the same cli from either windows or linux.

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...