11
coderme
3y

Am I the only developer in existence who's ever dealt with Git on Windows? What a colossal train wreck.

1. Authentication. Since there is no ssh key/git url support on Windows, you have to retype your git credentials Every Stinking Time you push. I thought Git Credential Manager was supposed to save your credentials? And this was impossible over SSH (see below). The previous developer had used an http git URL with his username and password baked in for authentication. I thought that was a horrific idea so I eventually figured out how to use a Bitbucket App password.

2. Permissions errors
In order to commit and push updates, I have to run Git for Windows as Administrator.

3. No SSH for easy git access
Here's where I confess that this is a Windows Server machine running as some form of production. Please don't slaughter me! I am not the server admin.
So, I convinced the server guy to find and install some sort of ssh service for Windows just for the off times we have to make a hot fix in production. (Don't ask, but more common than it should be.)
Sadly, this ssh access is totally useless as the git colors are all messed up, the line wrap length and window size are just weird (seems about 60 characters wide by 25 lines tall) and worse of all I can't commit/push in git via ssh because Permissions. Extremely aggravating.

4. Git on Windows hangs open and locks the index file
Finally, we manage to have Git for Windows hang quite frequently and lock the git index file, meaning that we can't do anything in git (commit, push, pull) without manually quitting these processes from task manager, then browsing to the directory and deleting the .git/index.lock file.

Putting this all together, here's the process for a pull on this production server:
Launch a VNC session to the server. Close multiple popups from different services. Ask Windows to please not "restart to install updates". Launch git for Windows. Run a git pull. If the commits to be pulled involve deleting files, the pull will fail with a permissions error. Realize you forgot to launch as Administrator. Depending on how many files were deleted in the last update, you may need to quit the application and force close the process rather than answer "n" for every "would you like to try again?" file. Relaunch Git as Administrator. Run Git pull. Finally everything works.

At this point, I'd be grateful for any tips, appreciate any sympathy, and understand any hatred. Windows Server is bad. Git on Windows is bad.

Comments
  • 3
    Use git GUI!
    It's best for windows!
    I mean not bad as the git bash, but sometimes git bash way useful

    It's like paradox!
  • 2
    Well I am on windows and I do have an SSH key and I can use that to push and pull over SSH.
    Well I've never had any permission issues. Are you sure you're not trying to put your repo into a system area?
    SSH server. Running on windows? Dafuq.
    Well why don't you use a git server on the prod server? Like gogs for example. You could have the deployment procedure in triggers to be called on push.
  • 1
    I do not understand. For me the only difference is that windows has support for the free SourceTree, and linux has nice autocomplete and git status in my prompt.

    Windows worked with keys just fine, and everything else as well.

    And even with the terminal, I just used linux subsystem for the missing features.
  • 2
    Nothing you said makes any sense. The git credentials saves your credentials and you normally never have to type it again. As others mentioned, never had permission errors either. You can use git bash for ssh.

    What are you talking about dude!
  • 1
    I had similar and I think because I check out with someoneelse@xxx... it always asks for the password so I did fresh clone and was fine. Windows does have some issue with file in use error and I get problems sometimes where checkouts fail. I think *nix file systems handle file pointers better so you can have a file open and move or delete the directory entry without any error because the file and directory entry are two different things.
  • 3
    This sounds like more of an IT/company based issue. After about 2 years of using git across windows, linux and even macOS I haven't had any of these issues nor anyone I've worked alongside with. Try talking to IT to see whether they have set any firewall rules or something
  • 1
    @Nawap git GUI doesn't solve any problems mentioned here, does it? I've used it and I'm generally not impressed.
  • 1
    @AndSoWeCode This is an older version of Windows Server, which doesn't have a Linux subsystem and may well be the source of some of my other issues.
  • 1
    @tahnik I didn't install this, the system admin did and I think that's the root of the permission problems. Remember this is a shared server, not my personal development workstation.

    I understand how credential manager is "supposed" to work.
  • 1
    @spacem yeah, the permission errors are only when git tries to remove a file - everything else works fine.
Add Comment