I just upgraded to Git 1.8.0.1 for Windows, from my previous version 1.7.9.mysysgit.0. I downloaded the new version from the Git site and installed through the normal Git installer EXE.
That said, when I fire up my terminal window, it still is showing that I am running git version 1.7.9.mysysgit.0. When I type "git --version" from my prompt, same thing.
I found this article on a similar issue with Git on Mac OSX, which leads me to believe that it has something to do with a faulty PATH, but I'm still pretty new at all this (5 months self-taught), so I'm at a loss in how to translate this to Windows.
This problem arose when I began a new Rails project and tried to push it up to Git. I added the remote:
git remote add origin git@github.com:brianscottk/blog.git
then:
git push -u origin master
I received the following error message:
fatal: https://github.com refs not found: did you run git update-server-info on the server?
Googling that error led me to this article, which prompted me to upgrade, and here I am.
Using the command "where git" find out how command prompt picks up the version. Once you have the path, you can go ahead and uninstall / delete previous version completely. Then if you install and make sure the new installed location is in the path, it should just work fine.
Using git-friendly tools like cmder will make your life much easier. You don't really have to use dual boot or cygwin anymore since the support for git in windows is already top-notch now. (Git for windows installs msysgit which includes all necessary unix tools from MinGW. MinGW has been there for a while and is pretty stable. If you want you can install the full version of msysgit rather than Git for Windows. msysgit is available on Git for windows page at the bottom.)
Based on the last response from @Simon, I first uninstalled the new version of Git. I then re-installed the new version of Git into the same directory as the old version,
C:/RailsInstaller/Git
, instead of the default directoryC:/Git
.Now my rails terminal window shows that I am running the new git version 1.8.0.
Since Git 2.16.1(2) you can use
In versions between 2.14.2 and 2.16.1, the command was
(It was later renamed to avoid confusion with updating the local repository, e.g. like
svn update
does it.)That command does not exist in Git 2.13 and before.
If this errors with "is not a git command" then either you don't actually have Git for Windows, or your version is very old.
In which case, simply get the latest installer from https://git-scm.com/download (check whether you want 32- or 64-bit) and run it to upgrade.
If you already have the latest version it does nothing, in which case you can manually run the installer to reinstall.
Update (26SEP2016): It is no longer needed to uninstall your previous version of git to upgraded it to the latest; the installer package found at git win download site takes care of all. Just follow the prompts. For additional information follow instructions at installing and upgrading git.
to check out your
PATH
variable, act as follow:Once there, scroll to get the
Path
row, you'll get a long string of paths (e.g.C:\windows\bin;C:\program files\git
, etc)Find the line or lines where
git
is referenced. Then, make sure this path point to your Git 1.8.x installation. If not, delete it and add the real path to the newest Git version. At the end, you should only have one path in the string linking to Git.Hope this help!
I don't think your problem is related to Windows global PATH, as
remote
is specific to repo.I recommend you to use Git under Cygwin. Git could work under Windows command line, but there may be some weird problems hard to figure out. Under Cygwin it's more nature and has less error.
All you need is to type
bash
in Window CMD then start to use the Unix tools and commands. You can use a shortcut to loadbash
, it's as easy as use normal Windows CMD.The same is true for Rails and Ruby. I used RailsInstaller before, but found using Cygwin to install Rails is more stable.
Finally I'll suggest to install Ubuntu dual boot if you have time(about a month to get familiar). Windows is not very friendly to every Unix tools ultimately. You'll find all pain stopped.