How do I setup git on Windows? - windows

I am very new to the terminologies: git, repository and cloning.
I was able to search them all online and get pretty good grip on each (pretty simple stuff!).
But what I am trying to figure out now is how to "run" these instructions:
Clone repository for app:
git clone git://github.com/SampleLink.git
Update submodules:
git submodule update --init
I am running Windows7. I tried to run init through command prompt, but no luck.
Are these supposed to be run as individual commands or as one following the other in sequence automatically?
I am just not sure how to run these on my Windows machine and cannot seem to get any of it to work.
The submodule is a file within the initial repository.
I'm sorry if this is a lame question, but I have never needed to run this type of setup before.

I would recommend installing msysgit in its "Git for Windows" instance:
Git-1.7.3.1-preview20101002.exe
I like using Option 2, only adding the git\bin directory to the PATH environment variable, but without overriding some built-in windows tools.
From there, git clone over http should work.

Related

VS Code not tracking file changes and says install git

extension: GitHub Pull Requests and Issues
Don't know why its behaving like this, git is installed... still its saying install git
showing:
Activating the Pull Requests and Issues extension failed. Please make sure you have git installed.
Go to setting and search git path
edit the setting.json in there, the last parameter git.path
find the git path with this command in terminal
which git
then reload the VS Code

remote-https is not a git command when cloning repo

On a Windows (version 10) machine, with the latest git client at the time of writing (2.18.0.windows.1), cloning repositories using HTTPS fails with error:
git: 'remote-https' is not a git command.
After a bit of research it turns out that git comes with several remote-<command> utilities, with remote-https being one of them. The error message therefore seems to tell us that `remote-https is not installed on the machine.
After a bit more research, it seems that similar problems for other developers were solved by installing curl. The machine we're dealing with does have curl (7.46.0) installed as well.
We tried reinstalling the git client a couple of times entirely from git-scm.com as well as gitforwindows.org, both resulting in the same error.
Any help or pointer to get this fixed is highly appreciated.
I just fixed the error in my build env. hope my solution is useful to you.
my env: Windows10+Jenkins+git
git version 2.18.
I just reinstall the git into windows, with a different selection during the installation:"MINTTY". after reinstall, I found the remote-https under my git install directory.
also, you need to set the jenkins env. make sure that the new git path which was included in the Jenkins env configure. if you "echo %Path%", and you can find the new git path which included the remote-https, then you are fine.

Git "add --patch" is not working

When I type git add --patch on my Windows 10 machine in the terminal, I get the error:
git: 'add--interactive' is not a git command. See 'git --help'.
I've googled to no avail, all other problems seem to be people running into this issue using other software or on Linux. Any tips?
This thread (for Git on Linux) mentioned the lack of a git-perl package.
But that should not be the case on Windows.
For testing, download PortableGit-2.17.0-64-bit.7z.exe and uncompress its content anywhere you want.
Then setup a simplified PATH:
set G=c:\path\to\latest\git
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\
In that CMD session, try again your git add -p command.

Git config values clash

I ran into big git configuration problem on my windows laptop. I downloaded Git for Desktop since I wasn't able to install git lfs to my cygwin git. I then removed the git from cygwin. I have a GitHub project which is using git-lfs for storing
large files. When I clone the project and it starts downloading files from the remote server it says:
WARNING: These git config values clash:
git config "http.sslcainfo" = "C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt"
git config "http.sslcainfo" = "/ssl/certs/ca-bundle-ghfw.crt"
Neither of those file locations exist on my computer. When I use git config --list I can see both values for http.sslcainfo. But the mingw one is not listed in with any of the git config --system --list, git config --global --list or git config --local --list. So I can't locate the file where
configuration is. I assume the Git for Desktop wants to use the /ssl/certs/ location since it sets it to git config --system when it is installed. I also have installed mingw on my computer but I couldn't find .gitconfig file inside it. Also I don't know why git would even look from there or where the configurations might be saved. I'm able to clone repository which doesn't use git-lfs. So is there any way to remove the http.sslcainfo = "C:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt" configuration? Any help will be highly appreciated.
first of all, i have to tell you that im not sure if i can help you. However, i want to share my information with you.... maybe it helps. I am tying out git-lfs for some big repos at the moment. I am using the bitbucket test server. Atleast on bitbucket, they say that files from git lfs are downloaded via HTTPS and need an ssl cert.
I hope that this helps you a bit. If you got more questions about this, feel free to ask.
Frossy

Gitolite on Windows - cloning stuck

I have installed gitolite on windows server using cygwin, installation steps went without problems and when I try to "ssh gitadmin#gitserver info" from local machine(windows) I get the correct response:
hello gitoliteAdmin, this is gitadmin#VRGWLSDEV1T running gitolite3 v3.6.1-6-gdc
8b590 on git 1.9.4.msysgit.0
R W gitolite-admin
R W testing
If I try to clone using Git Bash I get error:
$ git clone gitadmin#gitserver:gitolite-admin
Cloning into 'gitolite-admin'...
git: 'shell' is not a git command. See 'git --help'.
Did you mean this?
help
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If I try to clone using cygwin terminal on local mashine (using the same ssh key and I get the same valid gitolite message) it returns:
$ git clone gitadmin#gitserver:gitolite-admin.git
Cloning into 'gitolite-admin'...
...and stays like that for enternity!
I have searched for multiple solutions, added PATH (with Git etc.) to .bashrc and .bash_profile files on gitolite designated server. Also added PATH to .gitolite.rc to include custom Git installation path (before that I did not recieve the gitolite message)
If you have any solution or idea what did I do wrong: please....HELP.
Resolved it by myself:
Mysis Git installation was confusing Cygwin. Added Git pack to Cygwin and removed Msys Git env. variables: everything woks perfectly now.

Resources