Setup a git bare repo on a windows apache server - windows

I need help in setting up a bare git repo on an apache web server. I followed the below instructions
$ cd /var/www/htdocs/
$ git clone --bare /path/to/git_project gitproject.git
$ cd gitproject.git
$ mv hooks/post-update.sample hooks/post-update
$ chmod a+x hooks/post-update
I got these instructions from here
http://git-scm.com/book/en/Git-on-the-Server-The-Protocols.
I try to run
git clone "http://ip-addr/gitproject.git"
, but am not successful and neither the push command works. Do you have any suggestions on what to do next.

At least try it without the double-quotes:
git clone http://ip-addr/gitproject.git
And if it still hangs, check the log of your Apache server, to see if it is contacted at all.

Related

Git clone on windows : git#github.com is not a git command

I'm trying to clone a repository the ssh way from github and another form gitlab
I'm on windows EDIT : with Git v 2.29.2.2
I'm getting the following error, which I do not understand from what it is coming from :
$ git clone git#github.com:math-gallou/AI21_TPs.git
Cloning into 'AI21_TPs'...
git: 'git#github.com' is not a git command. See 'git --help'.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
So I also tried :
$ git clone "ssh://git#github.com:math-gallou/AI21_TPs.git"
and
$ git clone ssh://git#github.com:math-gallou/AI21_TPs.git
But the same exact error comes out.
When I do the ssh -v git#github.com I can connect with success.
So what did I miss ?
First, if you are trying the ssh:// syntax, then the URL would be:
git clone ssh://git#github.com/math-gallou/AI21_TPs.git
^^^ /, not :
Second, check if you have a %USERPROFILE%\.ssh\config file with a github.com Host entry in it, whose content might be incorrect or mis-interpreted.
In my case, I defined system environment variable GIT_SSH to use openssh I installed, and then git is broken and I got git: 'git#github.com' is not a git command. See 'git --help'..
After deleting system environment variable GIT_SSH everything works again.
Then I tried to define user environment variable GIT_SSH and restart system (I didn't restart system in previous try), somehow now my git works correctly with openssh I installed. I don't know which part is wrong in my previous try but I decide not to waste more time on this.

How to clear the (Master) sign from git bash?

I have a Windows PC with git installed. Whenever I start git bash, it always stands at /c/Users/_user with the master branch as below: user#DESKTOP-VE8378L MINGW64 ~ (master)
I guess it should look like user#DESKTOP-VE8378L MINGW64 ~
I had a look at people around, found out that they don't have (master) at their first start using git bash. I checked git repo at where I stand with git remote -v but there is nothing.
I tried git status but there is also nothing to help.
maybe you created a git repository in your home directory?
Do you have a .git directory in your home?
If that's the case you should move that repository in a different directory, or delete the .git direcotory if it was created by mistake.

git checkout downloaded files on Windows 7

My network from work doesn't let me clone any repository via Windows Git tool by command line git clone therefore I just download the repository.
My problem now is, I need to checkout by git checkout ###### but I cannot figure out how I can do that on my Windows 7. I have installed GitBash tool and Git Desktop, but as I said my network doesn't allow me to do much.
Option 1: local clone
Making a local clone should be your easiest option: it does not involve clone anything from the web so your administrator rules might allow it.
I'll assume you downloaded the remote into workspace/downloaded-bare.git:
cd workspace
git clone downloaded-bare.git sandbox
now you should be ready to work in workspace/sandbox.
Option 2: turn the bare into a working sandbox
If the local clone does not work, you can do the equivalent steps manually:
mkdir sandbox
cp -ar downloaded-bare.git sandbox/.git
cd sandbox
git init
and again, sandbox is now ready for normal work.

Why does my git bash always start at master branch?

I have a Windows PC with git installed. Whenever I start git bash, it always stand at /c/Users/_user with master branch as below:
NativeKiwi#nkiwi MINGW64 ~ (master)
I think it should look like this:
NativeKiwi#nkiwi MINGW64 ~
I had a look at people around, found out that they don't have (master) at their first start using git bash. I checked git repo at where I stand with git remote -v but there is nothing.
The string shown in your prompt depends on your PS1 environment variable.
Please check your .bash_profile or .bashrc for the configuration of PS1 environment variable.
I had the same issue (due to running git init) in the wrong directory and fixed it by running rm -rf .git in that directory.
You are seeing master because you created a git repository at the current path using the git init command. Always create git repositories in the folders containing project files. Consider running rm -rf .git command.

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