New to GitHub - Error when pushing to a repository - github

When I commit my changes and attempt to Sync / Push to my github repository, I get the following error:
HttpRequestException encountered.
An error occurred while sending the request.
cannot spawn askpass: No such file or directory
could not read Username for 'https://github.com': terminal prompts disabled
Pushing to https://github.com//ComicBookGallery
I am using VS2017 Community, and using the Github for VS Extension. I've googled this error but have been unable to solve. Running VS in administrator mode makes no difference,
Any ideas?
(I am logged into GitHub within VS, and can log into my account fine on github.com)
Thanks in advance

I went to the repository and searched for this issue, found this issue from today, where user #meaghanlewis states:
Today GitHub turned off TLSV1.1 in order to permanently disable deprecation of several weak cryptographic standards. You could read more about that here: https://githubengineering.com/crypto-removal-notice/.
To fix this issue, you should upgrade to the latest version of Visual Studio, 15.5.7- which provides support for TLSV1.2. This update allows Git to connect to services that have deprecated support for TLSv1 and TLSv1.1.
You might also need to sign in (or sign out and then sign back in) using GitHub for Visual Studio.
User #barsonax replied stating that upgrading it to 15.5.7 fixed it.
Hope this helps, but it's better to continue seeking help for this issue directly on the issue.

Related

VSTS keeps generating new personal access tokens

Recently I've been getting an email almost exactly every 20 minutes so with the subject "Visual Studio Team Services personal access token added". The content is something like this:
A new personal access token was added to your account
Git: https://[company account].visualstudio.com/ on [USER]
Scopes: vso.code_write vso.packaging
Expiration: 7/4/2019
The regularity makes me think it's something automatic doing it, but I don't know what that could be.
The auto generated PAT description with the format Git: https://[account].visualstudio.com/ on [machine] with the scopes Code (read and write) and Packaging (read) is caused by cloning VSTS git repo.
So please check if someone (or some code execute git clone operation) cloned VSTS git repo(s) on different machnes periodly.
Turns out the tokens were being generated by Atlassian SourceTree. I don't know what was happening or why it suddenly started, but closing SourceTree resulted in no new tokens being issued. Reopening SourceTree led to the tokens being issued again.
I upgraded SourceTree and Git for Windows and rebooted my computer, and that seems to have done the trick. I had already rebooted my computer since the issue started without that solving things, but the combination of rebooting and upgrading both Git and SourceTree seems to have resolved it.

Can't login to GitHub from SourceTree anymore

I was able to login up until today when it just stopped working. I'm using a Windows 7 machine. I have 2-factor authentication.
I've tried personal access tokens. I've tried deleting my credentials and re-adding them. I've tried nuking and/or updating credentials in Windows Credentials Manager. I've tried OATH vs Basic authentication. No luck. It just keeps asking me for "Username or email" and "password".
I've tried changing my GitHub password. I've tried authenticating with OAuth (SourceTree says it's connected, but then I get the login screen again).
Can anybody out there give me a list of steps to get back into our repo from SourceTree? I'm blocked now and unable to do work until I get this fixed.
Your git is out of date. You need to update your system git and then switch ST to use that. I think ST's embedded git needs to update the latest git version available on their server (complete guess). In the meantime, this works for me.
If you set Two-factor authentication in your Github, then just modify below in your SourceTree preferences.
Step 1: Change Auth Type to Basic
Step 2: Set Password as Access token
https://github.com/Microsoft/Git-Credential-Manager-for-Windows
"NOTICE: Experiencing GitHub push/fetch problems? As of 22 Feb 2018, GitHub has disabled support for weak encryption which means many users will suddenly find themselves unable to authenticate using a Git for Windows which (impacts versions older than v2.16.0). DO NOT PANIC, there's a fix. Update Git for Windows to the latest (or at least v2.16.0)."
I fixed it by updating both the Git Credentials Manager and Git itself.
I got this sorted today. My steps were as follows:
shutdown SourceTree
deleted everything in the Windows section under Credentials Manager
installed the latest version of GIT from Git Hub
start SourceTree. Deleted all the entries under Tools -> Options -> Authentication
Add a new GitHub hosting service using HTTPS & OAuth. Click 'Refresh OAuth Token’ and all was well.
SourceTree now functions normally for me.
Good luck and I hope this helps someone out there :)
I faced the same issue today, changing the Git version in Tools > Options > Git to use System Git instead of Embedded git resolved it for me. I had installed Git for Windows earlier in the day to continue with my work. So it must have used the Git installed then.
This might be the cause: https://githubengineering.com/crypto-removal-notice/
Last year we announced the deprecation of several weak cryptographic
standards. Then we provided a status update toward the end of last
year outlining some changes we’d made to make the transition easier
for clients. We quickly approached the February 1, 2018 cutoff date we
mentioned in previous posts and, as a result, pushed back our schedule
by one week. On February 8, 2018 we’ll start disabling the following:
TLSv1/TLSv1.1: This applies to all HTTPS connections, including web,
API, and git connections to https://github.com and
https://api.github.com. diffie-hellman-group1-sha1: This applies to
all SSH connections to github.com diffie-hellman-group14-sha1: This
applies to all SSH connections to github.com We’ll disable the
algorithms in two stages:
February 8, 2018 19:00 UTC (11:00 am PST): Disable deprecated algorithms for one hour
February 22, 2018 19:00 UTC (11:00 am PST): Permanently disable deprecated algorithms
The only thing that worked for me was navigating to
C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree
and removing the passwd file.
Once this file is removed, restart SourceTree and execute a fetch or something else that requires access to the repo in question. SourceTree will then prompt you for your password, rewriting the cached credentials.
https://community.atlassian.com/t5/Sourcetree-questions/How-to-update-HTTP-S-credentials-in-sourcetree/qaq-p/297564
(Sourcetree for Mac here)
After I've moved to 2fa on Github, I started having problems with Sourcetree, I've tried using system git but didn't work.
What worked was to change Auth type from basic to OAuth and reconnect account.
All I had to do was click 'Refresh OAuth Token' for my account in Tools -> Options -> Authentication.
I finally got mine working again. These are the steps I took.
In tools > options > authentication I deleted all the github authentication options and then re-added/authenticated again.
I then went to tools > options > git and updated the embedded git (I ended up installing the latest git for windows and using the system editor but I don't think that was the issue)
I then go back to authentication and chose "set default" on my github account which creates a "Rest saved passwords" item. In fact I had to click "set default" twice before it started working.
Testing after every step and trying to close down and open the app and after step 3 it started working. I am not sure if all steps were required but would recommend doing them all anyway as past times I've had this issue step 1 or 2 resolved it.
Ok, I don't have a complete answer, but I did get it working. The process was labyrinthine but mostly, it hinged upon #BillyTom's comment above about the phasing out of TLS 1.1.
This led me to the links I posted in reply to his comments, which got my git bash working again. SourceTree was still failing, however.
The final piece of the puzzle was finding Pageant running in my icons tray (why there?) and manually add the ssh key.
Now it's working.
I'm still a little perplexed by what all these steps are doing. I guess I need to bone up on security protocols.
Thanks, everybody, for all your help. I think I'm up and running again!
In addition to some of the answers above, this may be helpful (it's how I finally got it working)
I made sure had the latest version of Sourcetree
I upgraded to the latest version of and used System Git (Tools -> Options -> Git)
Upgraded to the latest Git Credential Manager for Windows (this was via an installer I downloaded and double-clicked, very easy)
Ensured I was using OAuth for my GitHub account stored in Tools -> Options -> Authentication
Made sure I checked off the box "Allow Sourcetree to manage my credentials using the Git Credential Manager" (this was important!!) on Tools -> Options -> Git
Then when I triggered the GitHub dialog (via pushing a new branch, just an example), I logged in there (this is where it used to fail).
I next got the 2 factor auth dialog, and the code was sent to my phone as expected. I was able to enter the code from my phone into this dialog.
I was getting
"Could not authorize request with the available token. Please re-authenticate."
on MacOS
..System restart solved this issue.
Oct 20th 2021, try updating the version of GIT Bash. I am guessing that a change in SourceTree or Github requires a change the GIT Bash client. I am moving from 2.27.? to 2.33.1

failing when trying to push to my remote git repository

i'm new use of VSCode. I'm trying to push my commits to remote repo, i'm getting credentials prompt, but i getting following output:
remote: Anonymous access to myname/myrepo.git denied.
fatal: Authentication failed for 'https://github.com/myname/myrepo.git/'
git fetch
Please help
Thanks
There are many people having this problem. I know it has been reported for a couple of times here: https://code.visualstudio.com/Issues/List
It seems those tickets are not available on public. File a new bug. Hopefully they are going to fix it until the next release.
I just had a problem where I was receiving a similar error, and I found these articles resourceful to fix this issue.
Potential reasons for problem:
Windows Credentials doesn't have the right Github credentials
Adding Git credentials on Windows
Github deprecated password authentication and you now have to use Personal Access Token when pushing
https://techglimpse.com/git-push-github-token-based-passwordless/
Hope this is helpful to anyone else that comes across this post.

Unable to clone this repository in Windows 8 RC with Github for Windows

I get the following error message when trying to clone one of my GitHub repositories in Windows 8 RC using GitHub for Windows:
Unable to clone this repository.
Please check your internet connection.
When I try to clone the same repository in Windows 7 using GitHub for Windows, it succeeds.
Cloning in Windows 8 progresses to about 9% before the error message appears.
I've checked the log file TheLog.txt, that says there's an error setting certificate verify locations:
2012-06-02 20:28:12.5876|INFO|GitHub.Extensions.ReactiveScreen|Activating GitHub.ViewModels.AboutViewModel.
2012-06-02 20:28:57.4916|INFO|GitHub.Extensions.ReactiveScreen|Deactivating GitHub.ViewModels.AboutViewModel.
2012-06-02 20:28:57.4916|INFO|GitHub.Extensions.ReactiveScreen|Closed GitHub.ViewModels.AboutViewModel.
2012-06-02 20:28:59.0532|INFO|GitHub.Models.RepositoryModel|Cloning [repository-url].git
2012-06-02 20:28:59.0532|INFO|GitHub.Helpers.GitRemote|Cloning '[repository-url].git' to 'Spotify-Metro-Style-App' in directory 'C:\GitHub
2012-06-02 20:28:59.0562|INFO|GitHub.PortableGit.Helpers.GitEnvSetupExtensions|Configuring SSH Agent: :
2012-06-02 20:28:59.0562|INFO|GitHub.PortableGit.Helpers.GitEnvSetupExtensions|PATH is C:\Users\EivindGussiås\AppData\Local\GitHub\PortableGit_0812189c12ccff4584523d6efce294a33dd2332a\cmd;C:\Users\EivindGussiås\AppData\Local\GitHub\PortableGit_0812189c12ccff4584523d6efce294a33dd2332a\bin;C:\Users\EivindGussiås\AppData\Local\GitHub\PortableGit_0812189c12ccff4584523d6efce294a33dd2332a\mingw\bin;C:\Users\EivindGussiås\AppData\Local\Apps\2.0\7VOQ2HDO.HJX\5506OVG3.2LE\gith..tion_8f45a2159c87c850_0001.0000_70cd4637d2963700;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\WINDOWS\System32
2012-06-02 20:28:59.0782|INFO|GitHub.IO.ObservableProcess|git.exe clone --progress --recursive [repository-url].git "Spotify-Metro-Style-App"
2012-06-02 20:29:02.2949|WARN|GitHub.Extensions.StandardUserErrors|Showing user and error Please check your internet connection.
GitHub.IO.ProcessException: Cloning into 'Spotify-Metro-Style-App'...
error: error setting certificate verify locations:
CAfile: C:\Users\EivindGussiås\AppData\Local\GitHub\PortableGit_0812189c12ccff4584523d6efce294a33dd2332a/bin/curl-ca-bundle.crt
CApath: none
while accessing [repository-url].git/info/refs
fatal: HTTP request failed
2012-06-02 20:29:02.2949|WARN|GitHub.ViewModels.ShellViewModel|User error encountered: Unable to clone this repository.
In Windows 7, where cloning the repository succeeds, nothing is written to TheLog.txt.
In Windows 8 RC the same error occurs on any repository I try to clone.
I sign in to Windows 8 using a Microsoft account, which has been a problem in Windows 8 CP with GitBash, because the user name is automatically set to include norwegian characters not supported by GitBash. As you can see, my home directory is C:\Users\EivindGussiås\.
Disclosure: I am a developer at GitHub.
This should be fixed in the v1.0.8.4 update we just released.
When I get this I usually just close it and reopen it, if that doesn't solve it then I log out and log back in, usually one of these fixes it.
This definitely looks like a bug ;-)
The blog post which announces the release of "GitHub for Windows" states
We make sure to read every mention on Twitter. If you find a bug, submit it to support#github.com. Every email is read by a real person.
"GitHub for Windows" is very frequently updated with bugs fixes and improvements. In order to get this fixed as soon as possible, I'd strongly suggest you to send them an email.
Thi issues's gone. The problem was with outdated libiconv-2.dll placed in c:\windows quite a while ago that caused conflict with the same DLL from GIT. As soon as I dropped the old one, GIT started working with flying colors!
I got this exact error when the credit card on the account was outdated.
To check if this is the case for you (paid accounts only of course), go to the website github.com, log in with your account, and check the header. If there is a red error text mentioning your credit card, there you go.
Here's the exact text:
We are having a problem billing your credit card. Please enter a new
card or call your credit card provider for details on why the
transaction failed. You can contact support#github.com with any
questions. Your private repositories have
been locked until you fix this error. Thanks for
understanding.

An internal Exception occurred during push: cannot store objects

Hello I am new to Git and trying to setup server part and client part.
On a Server side I have ssh access and Git version 1.5
On a Client side I have eclipse with eGit.
I created git repo on a server side via usual means: git init and added simple html file.
Using eGit I checkout the repo and everything seems to be going well. I made changes on a client side, committed it and decided to push back to the server.
Now I have all permissions set but still get following error:
I don't know how to fix it and error message doesn't provide much details.
Please help.
Thank you!
For me, on Windows eclipse, I had an error like this:
An internal Exception occurred during push: github.com/***/***/service=git-receive-pack not found
I just reconfigured the eclipse and added my github account information and store it. Then it worked. Team->Remove->Configure push to upstream->URI, Change->Add authentication details
Ok, I resolved my issue following way:
1) I changed configuration for remote fetch and pull from sftp to ssh
2) Once I did step 1. I got different error:
When I tried to push changes from Terminal I got following:
git push origin
Password:
bash: git-receive-pack: command not found
fatal: The remote end hung up unexpectedly
3) Found answer to the above error: git-upload-pack: command not found, how to fix this correctly
4) On my old server path to the git is: "/usr/local/git/bin" So I added it to .bashrc file.
Once I done that, everything started to work:
The possible issues are:
1. The source code might not be committed in the first place. Please try committing and see.
2. There is some issue with github authentication. Please re authenticate the credentials and try using: Team->Remove->Configure push to upstream->URI, Change->Add authentication