Accessing TFS code from Docker - windows

I have a docker running on my local Windows box and I need to clone the code from our TFS server using Git.
Docker is using linode/lamp (debian). Running # git clone http://our_server/tfs/The_Project
I get
Cloning into The_Project ...
Username for http://our_server: xxxxx
Password for http://our_server:
fatal: Authentication failed for http://our_server/tfs/The_Project

This does not look like a docker issue but just a case of git clone from Linux to TFS git repo: you can look there for an answer.
TFS requires Windows Authentication so your options are:
change TFS configuration to allow Basic Authentication
change TFS configuration to allow SSH
install Git Credential Manager for the OS in the container

Related

Need to clone repository after SSH into server using TeamCity

I have a job that SSH into server and after that I need to git clone repository into this server that I SSHed before. How could I do it?
I set VCS checkout mode on agent, and set custom path
I think there are two ways to achieve it:
Use SSH Exec runner to execute git clone on remote machine
Use SSH Upload to upload previously cloned repository to remote machine
First one is faster but you need to take care of git auth on remote machine.

Setting up Git Server on windows remote computer

I want to perform CI/CD on remote server running on windows for hosting my VueJs project. For doing that I have performed the following steps
I have added my ssh of my local machine to remote server as authorised keys and I am able to access the admin(cmd) remote server via ssh by using the following command.
ssh remote_server#<ip_address>
Using the above command the git bash opens cmd with following location c:/users/remote_user1 of remote server where I had added ssh of my local machine as authorized key.
I created bare git repo in C:/users/remote_user1 by logging in remote computer by rdp using the following command
git init test.git --bare
I gave Full access rights to test.git from remote server
I tried to clone test.git on my local machine using the command from git bash
git clone ssh://remoteserver#<ip_address>:/test.git
when I use the command from my local machine I get the error message from git bash
fatal: ''/test.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.
I am not able to understand what am I am doing wrong here, Please guide me on this.
The format for ssh urls must be one of :
# 'ssh://' url :
ssh://remoteserver#<ip_address>/test.git
# scp-like syntax :
remoterserver#<ip_address>:test.git
(link to docs)
The url you posted contains a :/ which makes it a mixture of both, you should modify this url to match one of the two accepted formats.

Pushing commits to an SSH-cloned repo via VS Code on WSL returns "Host key verification failed" - it's ok on HTTPS

I'm on a Windows 10 machine and I have both Git Bash and Ubuntu for Windows Subsystem for Linux (WSL) installed. When I use GitHub's official desktop app to clone a repo via HTTPS everything works fine and I can push my commits via Visual Studio Code with no problems whatsoever. I then try to clone a repo via SSH with Hyper (WSL Bash) and get this:
The authenticity of host 'domain.com (a.b.c.d)' can't be established.
RSA key fingerprint is XX:XX:...:XX.
Are you sure you want to continue connecting (yes/no)?
After answering yes and openning that repo in VS Code and try to push my new changes to GitHub, I get this error:
Git: Host key verification failed.
And this is what I get as Git Log in Output:
Host key verification failed.
fatal: Could not read from remote repository.
I have set up my SSH key on WSL using this method and I didn't set up any passphrase. I tried this on my brother's PC which is exactly set up like mine and it worked just fine. I would appreciate any help!
UPDATE: I typed ssh -T git#github.com in Hyper and got this as an answer: You've successfully authenticated, but GitHub does not provide shell access.
P.S. I'm a newbie in programming and stackoverflow, so please be concise and give me step by step instructions. The more you use technical terms, the more I'll probably get lost!
Try first, for that new push, to do it in command line:
cd c:\path\to\local\repo
git status
git log
git remote -v
git push -u origin master
Make sure that:
git status is clean (no pending changes)
git log shows you at least one commit
git remote -v shows you as origin the URL of your remote GitHub repository
(as an SSH URL git#github.com:<you>/<yourRepo>)
Then push, and go back to VSCode.
Should be faster than the other solution:
In vscode open a new terminal of type "Command Prompt"
Run: git push and accept the new key when prompted.
This will store the remote key for future use.

Visual Studio - Git clone fails over SSH, but works over HTTPS

I am using a fresh install of Visual Studio 2017 (15.8.1), and Git tools.
When I try to clone an existing GitHub repository, either by using the commandline tools, or by using git tools, I receive the following error message:
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
I believe this error is caused by SSH and I cannot seem to make git use HTTPS. Thanks in advance.
If you are using 2-factor authentication at GitHub
You must either do one of the following:
Use the SSH link, add an SSH key to your GitHub account and load it using the SSH agent in Windows, this may be done using Putty.
Generate a personal access token, and use the HTTPS link. Use your GitHub username as the username, but use the generated access token as your password.
If you want to clone any repository using https
Simply clone it using the HTTPS-link instead of the SSH link. You can find both links here, by clicking on Use SSH, you can switch to the SSH link:
In my case, I had to delete ~/.ssh/known_hosts file, so that a new one will be made next time you access git over ssh.

How to set up a git repository in Windows VPS?

I have a VPS - Windows Server 2012 R2 and I already install GIT on the server.
Now I want to set up a repository on it and our team can clone that repository to local computer and work on it.
I try to find the way to set up but I have not found any posts.
How can I set up it? Can I use any tool to set up on vps and commit from local machine?
You need a listener (Apache or ssh) in order for Git on your VPS to listen to Git queries (clone/pull/push)
You can use:
ssh (with an ssh server)
IIS (with Bonobo Git server)
https with a Go server (multiplatform) like Gogs

Resources