GitHub account to r studio - github

this is my first attempt at link my GitHub account to r studio an it gives me this error msg
>>> C:/Program Files/Git/bin/git.exe commit -F C:/Users/User/AppData/Local/Temp/RtmpoXbcuD/git-commit-message-42c06d1722c8.txt
*** Please tell me who you are.
Run
git config --global user.email "you#example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'User#DESKTOP-QNBSIRJ.(none)')
I read other similar question and tried other solution but it doesn't work for me

Related

remote: Permission to *****newuser.git denied to *****1stusername

in Visual studio code
i spent a lot more time for this, I'm trying push my deleted project that is coming from 1st account github into an existing repository in new another account, but I'm getting error like this :
$ git push -u origin main
remote: Permission to username/project_name.git denied to first_account_username.
fatal: unable to access 'https://github.com/user_name/project_name.git/': The requested URL returned error: 403
i tried those command line for push an existing repository in new account, please let me know what'd i miss ?
git remote add origin https://github.com/user_name/project_name.git
git branch -M main
git push -u origin main
Git obviously tries to push code to your new repository using your old username. Add you new username explicitly to the URL:
git remote set-url origin https://user_name#github.com/user_name/project_name.git
Or use the SSH syntax:
git remote set-url origin user_name#github.com:user_name/project_name.git
Question :
$ git push -u origin main
remote: Permission to username/project_name.git denied to another_username
fatal: unable to access 'https://github.com/user_name/project_name.git/': The requested URL returned error: 403
Answer :
Above the Setting icon in visual studio code there will be a Account Sign in logo icon, click and check it is login with another account or not ?
If it is log in with another Account you will be get the same error continuously... So,
The solution is : You should sign out the other Account in the visual studio and then try in visual studio code terminal following code given below...
$ git push
Then it will ask username and password
you should enter the correct details and it will work perfectly.
Just see the same problem and here is my solution:
Before we generate the token. We need to enable some elements of "select scopes in github settings as show below.
I just select several elements and generate key. Therefore I can push the code after fill username and password(generated key).
Check what configuration helper you do have: it might have cached the wrong credentials (from the old users).
git config --global credential helper
Adjust you PATH to use said credential helper.
If you are on Windows, in a CMD, set a simplified PATH like:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set "GH=%ProgramFiles%\Git"
set "PATH=%GH%\bin;%GH%\cmd;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%"
Then type in the same CMD:
printf "Host=bitbucket.org\nprotocol=https\nusername=old_username" | git credential-manager-core erase
Replace:
manager-core by your actual credential helper, as returned by git config --global credential helper
old_username by the old username GitHub account
Then try again.
First check your credentials:
git config --global user.name
git config --global user.email
Then change with:
git config --global user.name "email"
git config --global user.email "email#email.com"
If you set another credential before, will have problem
use git config credential.username "username"

"DontNeedGithubAccount" instead of username when pushing to Github with Intellij Idea

I'm trying to push to my github account from Intellij. Everything is working correctly. However, when I go from the browser into Github, instead of my github username the name "DontNeedGithubAccount" is being shown for the commits. I'm surprised that Google only has a few entries when searching for "DontNeedGithubAccount" but none of them are even remotely helpful.
Thanks to Ped7g, I figured it out: In your git config (.git/Config), you need to add
[user]
name = github_username
email = github_email#example.com
You can also achieve this by doing (use --local for current or --global for all repos)
git config --local user.name github_username
git config --local user.email github_email#example.com
The username must match the one on Github. If you additionally provide the same email you can click on your username and get to your account.

Git Bash still pushing with previous username

So, I am attempting to push a repository to Github using Git bash. The thing is, it still thinks that I am using a username that I was previously using. However, I changed this username and I checked to be sure with the following commands:
git config user.name
"CorrectName"
git config user.email
"CorrectEmail#correctdomain"
git config --global user.name
"CorrectName
git config --global user.email
"CorrectEmail#correctdomain"
However, Github is still using my previous user name to push the repo. This is evident by the command to push:
git push origin master
remote: Permission to CorrectName/CorrectRepo.git denied to PreviousUsername
fatal: unable to access 'https://github.com/CorrectName/CorrectRepo/': The requested URL
returned error: 403
What can I do in order to successfully push my repo?
Try removing you remote and re additing it.
git remote rm origin
git remote add origin <your origin url>
Ok, I got it to work. Someone helped me and advised me to run a
git config --local credential.helper "" command in my project directory and also a git config --global --unset credential.helper command. It seems like the credentials were still being stored somehow, but git asked for a username and password before pushing after unsetting the credential helper and the push was successful.
Remove your user settings:
Name:
$ git config --global --unset user.name
Email:
$ git config --global --unset user.email
or all your global settings:
$ git config --global --unset-all
Then set your username in git.
To check who you are:
$ git config --list

Error commiting files to GitHub

Whenever I try to commit a file to github i get the following error:
vanes#vanessaddiniz MINGW64 ~/HTML-CSS-and-JS---coursera/site (master)
$ git commit -m "Homepage"
*** Please tell me who you are.
Run
git config --global user.email "you#example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'vanes#vanessaddiniz.(none)')
This is the frst time I try to do this. I've just started a course on coursera and I did everything exactly as done in the video and everythig was going fine until now. How do i fix this? Anyone who can help me, thanks in advance!
P.S: I'm using Windows.
Git always requires an identification while making a commit to a repository. The identification it uses is either your name or email address. This will be used to show commits which belong to users in Git history. The above output already shows you what you need to do. Run the below commands with your name and email address filled.
git config --global user.email "Your email"
git config --global user.name "Your Name"
After this you should be able to commit to git.

The remote end hung up unexpectedly

I installed Git and ran the set up my username and email.
git config --global user.name "Your Name"
git config --global user.email username#gmail.com
Add your public key
Next, I created a project directory called 'projectname' and committed this to a remote Git server.
mkdir projectname
cd projectname
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git#github.com:projectname/projectname.git
git push origin master
My public key has been added to the github website.
When I try to commit I get this error message:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Any suggestions? - I am working with Ruby on Rails
Make sure you copy past the SSH key exactly like it's in the xxxx.pub file do not add lines or spaces to it.
Try again or delete both public and private keys and generate them again. It should work. Also remember to update the pub key again on Github website.
Also test your existing key with this command
ssh -T git#github.com