How do I unlink my computer from a github account? - macos

I've been able to push with the mac GitHub app to a GitHub repo, but I'm trying to use the command line now and I see this error:
remote: Permission to bfred-it/test.git denied to wildlifela.
wildlifela is a company account that I used recently on a different project, I think I only added my SSH key to that account.
The problem is that even after removing my key from that account (wildlifela), my account (bfred-it), the RSA keys from my computer (with ssh-add -D) and emptying the ~/.ssh folder, I still get that error.
It doesn't seem to be a repo issue: I just created a repo on GitHub.com, cloned it to my desktop, created a commit and git push origin master still produces that error.
After following the Generating SSH Keys procedure, ssh -T git#github.com authenticates me as bfred-it, but I still can't push as bfred-it.
What can I do?
(OSX 10.9)

I worked around this issue by using a different version of git.
Instead of using OS X's git I'm now using homebrew's git and it's working correctly.
If anyone has any insights as to what was happening, please share.

although i removed the ssh keys and the git config files from the OS, it just won't let me clone/pull/push to repositories
Check that the repo is indeed owned by you (for pushing to it)
There always is the option of using https url (with GitHub username/password)
removing the ssh key might not be enough, you also have the ~/.ssh/config file.
As mentioned in the comment, it can depend on your version of Git and on your OS (Windows, Mac or Linux).

Related

Sourcetree not working with SSH key on Mac upgrade?

I've recently upgraded my Mac to 10.13, I have a sourcetree where it was working fine before the update, now after the update I am not able to push anything to my repositories, although it used to work before, anybody encounter this before?
I found the solution:
Mac upgrade 10.13 involve some changes to OpenSSH policy, you can read about it here: https://developer.apple.com/library/content/technotes/tn2449/_index.html
You will need to add the identity to the list from terminal:
run:
ssh-add -l
you will get "No identity message", you should add you SSH key, run:
ssh-add ~/.ssh/id_rsa
Check that the change is made by running the first command again, then you should see that the key is add.
Now you all set and Sourcetree will push normally.

Does SSH server need to be running in a unix style environment on remote client for GIT clone to work?

I am tasked to set up a central GIT repo internally for my team.
I'm working on getting this setup on a Windows Server 2012 R2 machine. To the best of my knowledge I've set this up correctly.
I have been following this tutorial but they use CopSSH which isn't free anymore so instead I installed Windows OpenSSH here: Install-Win32-OpenSSH.
On our windows server I've installed and configured the Windows OpenSSH along with GIT. Made the appropriate changes with regards to the environment variables and references needed.
On my local system (also windows) I've installed Putty and generated my public and private keys. The public key has been copied to the server and placed in the correct file. Using putty, I have verified my public/private key authentication is working.
On the server I created a git bare repository in the C: drive like so:
cd C:\
mkdir testing.git
git init --bare testing.git
I installed GIT on my local machine and run the command:
git clone ssh://name#host:port/testing.git
I always end up with the output:
Cloning into 'testing'...
fatal: ''/testing.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've tried different variations of this command with the same results and moving the testing.git file to the user home directory (C:\Users\name):
git clone ssh://name#host:port/c/testing.git
git clone ssh://name#host:port/~/testing.git
I've messed with permissions to explicitly give permissions for this user to access that directory.
It seems as though, maybe the git clone command cannot find the folder on the remote server. I started thinking that the SSH server itself needed to be running in a unix like environment like cygwin. Is this my issue? I've seen tutorials/walkthroughs of installing cygwin with openssh and this would be my next attempt.
Thanks for any help!
EDIT:
So I went ahead and installed Bitvise with their 30 day trial (to try) and everything works but this is only for 30 days. So this must mean that there is some set up issue with the Windows OpenSSH that I have?

Cannot Clone GIT Repository from windows server but can SSH

I have a seen a lot of posts related to the error I am getting but can't find anything that seems like a potential fix I would like to try without getting feedback from some people who know better.
The Setup: I recently built a Windows 7 PC and installed Apache, PHP and MySQL. Everything is working great with my setup and I opened the server up to other devices on the LAN. When I go to a browser and navigate to IPADDRESS:PORT (Installed Apache to listen on a custom port to avoid potential conflicts (Skype, future IIS install?, etc) I get my htdocs index.php page. Great so far.
The last thing I wanted to do was setup Git so that I can do work for my server on my Macbook Pro and push changes to the server. To get this up and running I installed msysgit on my server and was able to create a Git repository for a Media directory I created at the root of my server. When I open this directory up in Explorer I can see the .git directory. The next thing I did was install OpenSSH on the server and I got that up and running. I also changed the default home directory of an SSH connection to the htdocs folder of my Apache server.
Now when I move over to my Macbook pro to test the setup and I am getting problems.
SSH seems to be functioning as expected. When I am on my laptop and run ssh USERNAME#IPADDRESS I get the message to enter my password, I enter my login password and awesome I am in the shell of my server at the htdocs directory.
Git does not seem to be functioning as easily though. I have Git on my Macbook Pro and was able to create a repository in a local directory no problem. When I navigate to a new directory in Terminal that I would like to work with the Media folder project I created on the server and run the following Git commands:
git clone USERNAME#IPADDRESS:/Media
git clone USERNAME#IPADDRESS:\Media
git clone USERNAME#IPADDRESS:/Media.git
git clone USERNAME#IPADDRESS:/Media/.git
etc
(Not sure what exact command I'm supposed to be running. Do I need .git at the end of this command? I see a hidden .git directory in the Media directory but I don't see a Media.git file.)
I get the following error:
Received disconnect from IPADDRESS: 2: fork failed: Resource temporarily unavailable
fatal: The remote end hung up unexpectedly
Based on my searching I can't tell if this error is coming from my client (Macbook Pro) or server. I read that it could be a threading limit set on my Macbook so I entered the following commands and upped my maxprocperuid:
sudo sysctl -a|grep maxprocperuid (which outputted 709)
sudo sysctl -w kern.maxprocperuid=3000 (upped it to ridiculous number to see if it was the problem)
But I am still getting the error when trying to clone the repository.
If you've gotten to the end of this thanks, just trying to provide as much info as possible and any help would really be appreciated.
Thanks.
Try uninstalling OpenSSH and then installing WinSSHD again. Check out this link which suggests the same.
Also, this question might be of some help to you while you are at it.
Git doesn't use ssh by default so you have to specify it when cloning
git clone ssh://[username]#[ip-address]:[port][/path/to/repo]

Bitbucket, Windows and "fatal: could not read Password for"

I recently reinstalled Windows and I have a problem with downloading files from repository.
I have installed GIT and Python, but when I am trying to download anything from Bitbucket I get the message:
"fatal: could not read Password for: 'https://username#bitbucket.org': No such file or directory".
What am I doing wrong?
I solved it setting a global parameter:
git config --global core.askpass /usr/libexec/git-core/git-gui--askpass
Try to include your username and password in the URL like this:
git clone https://username:password#bitbucket.org/path_to/myRepo.git
I had the same problem an hour or so ago. My issue was that I was trying to do a git clone but using the https url instead of the ssh one. If you go to your repository you can select ssh or https from the dropdown for the clone url. Hope that helps!
Just solved this Problem
Git in Version 1.8.5.2 contains a but using bitbucket, updating my Git to Version 1.9.0 solved this problem.
I just tried to do the same thing and it did not work for me, and I too recently reinstalled windows on my machine.
I am used to checking out a private repo from my bitbucket account by using the simple command
git clone https://username#bitbucket.org/username/repo.git
and then being prompted to enter a password for my user.
It looks like this might be broken in version 1.8.5.2. I downgraded to version 1.8.4 and it started working as expected.
Git download list: http://code.google.com/p/msysgit/downloads/list
Hope this helps!
For https connections try installing the "Git Credential Store" (an "optional" step in the BitBucket tutorial).
This is how to install it:
Download git-credential-winstore.exe from http://gitcredentialstore.codeplex.com/
Open the Git Bash Shell and change the current directory to where git-credential-winstore.exe is located
Run ./git-credential-winstore -i /bin/git
Try to use git fetch in order to reenter and update the outdated password.
I had the similar issue. The cached password become invalid due to updating the actual password to new one. But git didn't ask me for reentering the valid password and just gave me an error that Authentication failed while I was trying to pull changes.
But magically, git asked me for the actual password when I typed git fetch instead of pulling the data. Once I entered the new password, apparently git updated the old one in its credentials storage and no longer asked me about the entering password again.
FIX IT (09/2020)
All the the answers here are wrong... You shouldn't NEVER do something like that:
https://username:PASSWORD#Bitbucket.org
SOLUTION
All you have to do is:
Go to Sourcetree -> Preferences -> Git
You will have the section "Git Version" with 2 options: Reset to ebedded Git and Use System Git
Sourcetree use the Ebedded git for default.
Click on "Use System Git" and.... Fixed!
Follow me on:
GIthub
Twitter
In my case, the problem was with the global file .gitconfig on Windows.
When I tried to use solution provided by #jsarroyo in Git BASH, I got an error saying that the file .gitconfig.lock did not exist. I could find no way to fix it.
When I completely removed .gitconfig, everything worked fine.
WARNING: This way, you lose all your git settings and you need to configure it again.
In your project go to .git/config and add after username :password
before : https://username#bitbucket.org/repo.git
afetr : https://username:password#bitbucket.org/repo.git
I had the same problem with the Android Studio Chipmunk 2021.2.1 Patch 2 integrated version control. Additionally I have BitBucket and GitHub ssh keys setup on my Windows PC. I was able to fix the issue by setting checked Use credential helper in File | Settings | Version Control | Git
In my case, it was just a wrong password for bitbucket entered into the prompt dialog. When I entered the correct password, the error disappeared.
If you are using android studio you might want to try enabling "Use credential helper".
Steps:
Go to File -> Settings -> Version control -> Git
Find "Use credential helper" option (mostly at bottom)
Enable this option by marking the checkbox before the option
I got this issue when I upgraded from Windows 7 to 8 and settings messed up for me too. I had to regenerate private and public keys, and change my TortoiseGIT to use plink, instead of SSH.exe
I wrote step by step instructions at http://techblog.saurabhkumar.com/2015/09/using-tortoisegit-on-windows-with.html
For Bitbucket If you are ok for the repo to be public you can just uncheck the "This is a private repository" checkbox in repo settings. Now a simple git clone should work.

Git fails initial push to new repo on network drive

Can you help me understand why my simple startup project is not working? I am using Windows XP, with Git installed from Git-1.8.1.2-preview20130201.exe. I am using Git Bash provided with the installation.
On the networked drive I do the following:
cd /k/repos
mkdir LV_Libraries.git
cd LV_Libraries.git
git init --bare
At my local copy of the project:
git init
git add *
git commit -m "Initial Commit"
git remote add origin /k/repos/LV_Libraries.git
git push origin master
The push fails saying,
"remote: error: unable to write sha1 filename ./objects/pack/pack-b69cd03c4c ... .pak: Permission denied"
"Remote: fatal: cannot store pack file"
"Error: unpack failed: index-pack abnormal exit"
"To k:/repos/LV_Libraries.git
! [remote rejected] master -> master (unpacker error)"
I initially thought it might be a file permissions thing, but I have no problems writing or reading files to the network drive through my terminal. Does anyone have any ideas?
Sounds like you are having problems similar to this question git: can't push (unpacker error) related to permission issues, i.e. permission problems on the k: disk, possibly related to user permissions.
Have you checked the exact permissions that you have on the UNC path for folder on K:?
I encountered this issue when attempting to push changes from a Windows machine via a Samba share hosted on a Mac OS X machine. I resolved this by initializing a SSH server on the Mac OS X machine and then cloning the project again via SSH on the Windows machine. Hence, all subsequent pushes from the Windows machine have worked beautifully without any errors.
When I checked out the project, via the Git GUI for Windows, I used the following syntax for the repository:
ssh://username#machost_ip:full_path_to_project
The username was the username used to create the project, the machost_ip was the IP address of my Mac OS X machine on my LAN, and the full_path_to_project was the fully qualified Unix path to the origin/master Git project.
I did not have success with the continued use of the shared drive even after changing group permissions. Although, I'm sure the username could be that of a user assigned to the group with write privileges to the project as specified in previous answers.
I deleted my git repository and then recreated it with
git init --bare --shared
and this solved the problem for me. Other answers mention setting config for shared and bare, but I found that only recreating the repository helped.
Have are your CRLF settings?
When playing around with the settings, I managed to generate a change that caused an problem identical to yours. In the end, I create a new clone of the remote repo and slowly merged my changes back to it.
I encountered same error yesterday. I am simply trying to clone one Big Git repository to my local windows machine using Git Bash 2.9.2.
After killing significant amount of time and reading above answers. I ran Git Bash as administrator and it worked like a charm. I am able to clone repository. Not sure what is the issue, I guess it is most probably related to permissions as many pointed.

Resources