I know github has changed the code push strategy and made it a token based one, even though I haven't tried it yet, but is there a way to push the code to github by using username/password as I am using a temporary laptop and don't want to save any personal details.
I am getting the below error:
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
is there a way to push the code to github by using username/password as I am using a temporary laptop and don't want to save any personal details.
You can generate a PAT just for that temporary laptop
Or you can generate an SSH key on that temporary laptop, that you will use only there, with an SSH URL.
In both instances, you can revoke (the PAT or the public registered SSH key) later on, when you no longer use that temporary laptop.
Related
I want to push my project to my Github account. I am able to connect with my account and create a new repository on Github. But when I then want to push to that remote for the first time, I cannot seem to be able to provide the system with my credentials.
Specifically, I cannot change the username to anything; it in the textfield just says git and I can't fill in my real username.
Xcode Version is the currently latest 9.2, if that matters.
Any hint or help is highly appreciated!
Figured it out: I had chosen to clone using SSH, and Xcode automatically used me private key I had stored in ~/.ssh/. I even had provided my passphrase for the private key under Accounts in Xcode.
The thing that was missing on the Github side was the corresponding public key. After having provided my Github account with that, pushing works like a charm.
Hope this helps someone some time, cheers.
I am running Git on OSX Mavericks and have not had issues until now. What has changed is that I'm trying to use two Github accounts on different repos on the same computer.
The problem is that the osx-keychain is storing the login information from my first account. That was terrific before, but whenever I try to commit or push from my new Github account, it is defaulting to use the keychain's username and password values, and ignoring the locally-defined git config (or even global git config!) files.
I can delete my osx-keychain, and then push to the new account, but in doing so it will create a new keychain for that account, which puts me back at square one: able to push to my secondary account with the new keychain values but locked out of my primary account.
So I'm stuck in an "either-or" situation, and I'm really hoping there's a "both" solution. Any help?
P.S. I have tried this solution, and it did not work, as the osx-keychain appeared to override the SSH Identity functionality
If you are using https url, then the solution you mention wouldn't have any effect: it is for multiple ssh keys.
Regarding https, this question mentions a few solutions, including:
By default gitcredentials only considers the domain name.
If you want git to consider the full path (e.g. if you have multiple GitHub accounts), set the useHttpPath variable to true, as described at gitcredentials.
Note that changing this setting will ask your credentials again for each URL.
By default, Git does not consider the "path" component of an http URL to be worth matching via external helpers.
This means that a credential stored for https://example.com/foo.git will also be used for https://example.com/bar.git.
If you do want to distinguish these cases, set this option to true.
Also, make sure your https url incudes your account name:
git clone https://user1#github.com/auser/aprojectX
git clone https://user2#github.com/auser/aprojectY
That will help a credential helper to known which account/password it should be looking for.
Finally, the authentication you are using for accessing a git repo hosting service has nothing to do with:
git config (--global) user.name
That last config is only for setting the author associated with your local commits.
It is not for selecting the account used to access a remote hosting website.
I use git-credential-winstore (installed with msysgit) to store my personal GitHub account details in Window's credentials store (Control Panel -> User Accounts -> Manage your credentials -> windows credentials) I'm now trying to use a second GitHub account. I've modified the local git.config (git config user.name "foo") but when I push, it's still trying to use the personal GitHub credentials. I know I can change the repository url from https://github.com/user/project.git to https://user:password#github.com/user/project.git, but I'd rather not take the security risk by embedding credentials in the git.config. I know I can go into Control Panel and flip the credentials back and forth, but that's really annoying. Is there a way to store multiple GitHub account details in git-credential-winstore and configure each repo to use one or the other?
I have forked the git-credential-winstore to support multiple github logins.
You can find my fork here: https://gitcredentialstore.codeplex.com/SourceControl/network/forks/nickmeldrum/gitcredentialstore
(I have sent the original author a pull request but it doesn't look like he accepts them/ maintains the project anymore.)
The simplest way to use my fork would be:
Clone the repository locally: git clone https://git01.codeplex.com/gitcredentialstore
Build the project using the Debug configuration (should build from scratch with Visual Studio or MSBuild: msbuild.exe .\git-credential-winstore.sln)
Run the command: InstallLocalBuild.cmd to setup git to use this version of the credential helper
If anyone actually uses this fork and tells me about it, I will set up a proper binary download in codeplex!
Key piece of info:
In order for this to work you need to tell git the username that you want to use to connect to that particular remote in that repo. You do that by specifying it in the remote url. For example:
git remote set-url origin https://username#github.com/username/repository.git
I am very new to coding, I have actually just started learning how to through the use of video tutorials. Anyway one of the steps along the path of learning is setting up an account on GIT and linking this account to my ruby command prompt, where all the work I do is saved onto this app.
The problem I have run into is that, for some reason, after following the instructions of both GIT and the video tutorial I am not quite able to do the following step.
git push -u origin master
the error I get is:
warning: Permanently added to the RSA host key for IP address .....
Permission denied (publickey).
My best guess is there is an issue with being an administrator or something along those lines but I do not possess the knowledge to change that at the moment.
I would like to point out here that I am a windows user, I have seen a lot of "solutions" out there which simply dont work for me as they include commands like "sudo" or others which do not exist in the windows format, well at least not on mine as I have decided not to go through Cygwin.
Any help would be appreciated. Thanks in advance to who ever tries to help!
The issue is with your SSH public key. Somehow the git server is not able to recognize you and refuse to accept the code you pushed.
SSH keys are stored in ~/.ssh/. You should make sure there's one created. If there's one, then link it with your git server account, otherwise, create one and link it.
Checkout this tutorial on creating SSH keys: https://help.github.com/articles/generating-ssh-keys#platform-windows
Weeks ago (and in a fog), I needed to make some changes to something hosted at github. I was directed by someone-who-knows-more-than-me (SWKMTM) via phone on exactly what to type in order to configure, pull down, modify, push back and then activate things. Part of this involved issuing instructions to git that said I as SWKMTM.
Now that I've had time to learn a bit about git/github (as well as to recall my github login information), I've gone back and tried to substitute my identity for SWKMTM on my client machine (a la git config --global user.name and git config --global user.email). After doing this, I can perform the same update activities as before. However, I have yet to be prompted to enter my github password (i.e., there is NO request to enter my github password). I'm assuming that something has been cached identifying me as SWKMTM (and that I must've done something in the earlier fog that involved entering SWKMTM's github password) -- either locally or by implicitly sending my SSH public key.
I've searched around in vain for .*rc files and configuration directories for anything that resembles credentials that might be associated with SWKMTM (in hopes of dispatching said credentials and forcing git to prompt for new ones). I've similarly failed to find anything at github that might tell if there is some sort of aliasing for public keys (and how it might be purged).
I've also tried the advised "git config -l" for any credential helper and have found none.
How can I force github to forget that I've been masquerading as SWKMTM?
[sidenote: this is on MacOS with no indication in config files that credential-osxkeychain is used. Only after using GIT_TRACE=1 on a push was it obvious where the credentialing was stored.]
user.name and user.email have nothing to do with credentials, they are just strings that are put into each commit you make to store your authorship information.
Git normally authenticates you via SSH, so you have to either copy your SSH private key from the other machine to your new client, or create a new key pair and add the public part to your github profile.
OK, after extensive discussion in the chat it turns out that Git was using the osxkeychain credential helper which provided previously stored credentials.
Remove your stored credentials from your OSX keychain or disable the crendential helper (credential.helper config option) in Git to be prompted for authentication again.