MSysGit Not finding Repo - windows

So I had a repo working by adding it to the htdocs in apache, however, I couldn't commit. So I set up SSH (I am using copSSH) and I can ssh into the server and see the files in my project.git. However I get the following when I try to clone...
$ git clone un#server:/home/un/Repositories/git/test.git/
Cloning into 'test'...
un#server's password:
fatal: '/home/un/Repositories/git/test.git/' does not appear to be a git re
pository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Any ideas?

Oops this did work...
git clone un#server:Repositories/git/test.git/
Must be an environment var issue

Related

Unable to pull and push to git via cmd

I got a problem. A am trying to learn git. I initialized my local repo, added everything, committed. I'm using atom cmd and bash, because there are some commands, that are unavailable in atom cmd. I created an ssh-key, added it and everything works fine. I am trying to synchronize everything and pull from the remote repo, but I am getting an error:
PS C:\Users\keldranase\Documents\Obsidian Vaults> git pull origin master --allow-unrelated-histories
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
At the same time, when I am doing same using bash, everything works fine:
keldranase#DESKTOP-SH6U8NC MINGW64 /c/users/keldranase/documents/Obsidian Vaults (master)
$ git pull origin master --allow-unrelated-histories
Whats the reason behind this? How to solve this problem? What am I doing wrong? Your help would be appreciated.
Screenshot:
Your SSH key is not loaded. You need first to start the ssh client and then add the ssh key, you can find more information here. And here you can find some useful troubleshooting information for your error and other issues you might experience with SSH - Error Permission Denied.

git clone from bare repository

I created a Visual Studio project using git, later I created a remote bare repository in the path \\xxx.yyy.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib and added it as origin in Visual Studio, then pushed.
Remote repository seems to be up to date, and from command line a git remote -v in the local folder returns these 2 lines
origin \corp.repower.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib (fetch)
origin \corp.repower.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib (push)
I assume I can clone to another local folder from the remote path, so I just copied and pasted exactly the line above to clone it elsewhere
git clone "\\xxx.yyy.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib" .
Now I get an error
git : Cloning into '.'...
fatal: '\xxx.yyy.com\dfs\CORP\Wkg\MoDat\tmp\avl\Repository\WCF\MIlib' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I am cloning in the same system in another folder using the same (administrator) user, so it's definitly not relate to access right.
I see in the error that a \ is missing, am I doing something wrong? should the path be somehow escaped?
Are you writing these commands in some kind of bash?
When I was working on Windows I always used forward slashes / instead of backslashes. See if it works for you.

Git and SSH - How to know what address to use?

I need to set up a git repository in the production server so I can upload all my commits. So, these are the steps I followed:
Production Server (Windows Server 2008)
Installed Git
Created an empty repository at inetpub/wwwroot
Installed CopSSH
Created a new user account
Enabled the user with CopSSH
Changed the default directory of the new user to the repository address
Setted environment variables to read Git commands
Development (Windows 7 + Netbeans)
Installed Git
Created a repository right where my project is
Added all files of the project to the repository
Now, I need to upload my dev project to prod. First, I'm checking if the SSH default directory where I'm pointing to is a repository:
$ git ls-remote ssh://user#server/
fatal: '/' does not appear to be a git repository
fatal: Could not read from remote repository
Please make sure you have the correct access rights
and the repository exists.
I tried adding the folder name, ".git", foldername.git, everything, and I get the same error.
Where am I having the issue? Thank you beforehand.
P.S. I already tested the new default directory and it points right to the empty repository in the server, so it's working.
EDIT: I tried this:
$ git ls-remote user#host:.git
user#host's password:
$_
I got no output. Is that okay?
You're saying the git repository at your server is located at / (say, you should have a /.git directory). As that's probably not true, I'd suggest you to connect via ssh to the server and run pwd (or it's Windows equivalent) to found where your home directory is, and then get the relative path to your repository.
Say, if running pwd right after logging into the server gives you C:\users\my_user and your git repository is at C:\users\my_user\git\my_project, use ssh://user#server:git/my_project as the URL. The : means a relative path from your home directory.
Also you can use an absolute path, as in ssh://user#server/c/users/my_user/git/my_project, or however Windows decides to name your C: partition :)
As you use ssh transport, your syntax tries to access the root of your Copssh installation, Example: if you installed Copssh at c:\copssh, then your root (/) is the same directory.
Your command git ls-remote ssh://user#server/ tries to access that directory.
Try something like
git ls-remote ssh://user#server/home/user* (c:\copssh\home\user) or
git ls-remote ssh://user#server/cygdrive/d/mygit if your repository is at d:\mygit)
If you all want to create a Windows based Git repository, you may consider to stick with Gitwin which has a fully functional free edition. It is Git on Cygwin though and Disclaimer: I'm the developer.

Gitolite, can't clone new repo

I've just installed gitolite on my Debian server.
Then I cloned gitolite-admin repo and and new public key + following lines to conf file:
repo wallr_common
RW+ = wall
New repo was created after push.
At first I go to authorized_keys and saw that key for new user not exists, then I run ~/.gitolite/keydir$ gl-setup, and the key appears in authorized_keys.
Now I'm trying to clone it but I'm getting error:
git.exe clone --progress -v "ssh://wall#192.168.1.110:/wallr_common.git" "D:\wallr_common"
Cloning into 'D:\wallr_common'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
git did not exit cleanly (exit code 128) (5834 ms # 04.07.2013 0:27:46)
What can be the root cause of this?
You must use the git or gitolite account for your ssh session. Not the user account wall that you registered in gitolite.
That means ssh://git#..., instead of ssh://wall#....
Replace 'git' with the account you used to install gitolite.
See more at "How do programs like gitolite work?".
This is a similar mistake as in this question.

Unable to Change my Remote Repo

I am a bit new to git, and as a result I have gotten myself into a git mess. I have an Xcode 4.5 project. In the command line I have been managing its local git repo as well as a remote repo on github that the local one is linked to. All was well until I decided to delete the remote repo on the GitHub website (called PictureFly) and create a new remote repo on the GitHub website (called PhotoFly). I would like my local repo to be unlinked to the old remote repo (PictureFly) and linked to the new remote repo (PhotoFly). Seems simple, but no matter what command I enter, I get one fatal warning or another. Here is a typical example of what I have been doing:
My attempts to remove the old remote origin:
//first attempt
git push origin :https://github.com/jac300/PictureFly.git
//first error
fatal: remote part of refspec is not a valid name in
:https://github.com/jac300/PictureFly.git
//second attempt
git push origin :PictureFly.git
//second set of errors
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
//third attempt
git push origin --delete PictureFly
//third set of errors
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
//fourth attempt
git push origin --delete https://github.com/jac300/PictureFly.git
//fourth set of errors
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Then I thought maybe I can just add the new remote repo:
git remote add origin https://github.com/jac300/PhotoFly.git
fatal: remote origin already exists. //how does it already exist?
So since it "already exists" I tried to push to that repo:
git push -u origin master
fatal: 'git' does not appear to be a git repository
fatal: Could not read from remote repository.
I have no idea what is happening or how to fix it. Any help is appreciated.
You can easily remove the repo on GitHub and create a new empty one from the website. So now you're stuck with your remotes pointing to the wrong url. To fix:
git remote set-url origin https://new.url.here

Resources