Unable to push code to github as a collaborator - github

Whenever I'm trying to push my code to github as a collaborator I'm getting an error saying I don't have enough permission with error 403, although I'm added as a collaborator. I'm using linux.
I've created a personal access token for the account where I'm going to contribute (yes that's my account also) and used that token as password at the time of pushing and it worked but I know it's a workaround and not the actual method. How can I solve it?

Related

When i push into github from vs code it shows me the wrong user even though i have signed in with the right account

I am having a issue every time I push code into GitHub:
I have this account
and this is what it shows after I do a commit:
This is a name or nickname I have never used, and this shows for private repositories and public repositories as well.
After doing some research, I have removed Windows credentials of GitHub and VSCode to make sure that the issue does not stand there:
It did not resolve the issue.
I have tried the command to remove all credentials and add them again, I added them again but the issue still persists.
For some reason, every time I make a commit, unless I upload directly the code from github.com, it will show it with the wrong user as push.
Credentials are use to authenticate to GitHub, which check if your account (identified by the credentials) has the right to access/push to your remote repository.
This has nothing to do with commit authorship, which is only set by a local git config --global user.name or user.email.
Check first those settings, adjust them (especially the email one), and make/push another commit, to confirm they are properly displayed (with the right account)

Simple way to access code from a private Github repository in google colab?

I would really like to be able to import modules from a private Github repository into google colab.
I know I have access to this private repo because I pull and push from it regularly.
I went into Settings on google colab and connected my GitHub account, so that when I go to this section it says "You GitHub account is connected to your Google Drive account."
However, when I run the following code
from google.colab import drive
drive.mount(`/content/drive`)
I don't see any GitHub subfolder in /content/drive/MyDrive/
Alternatively, this site recommended going into GitHub "Developer settings" and using a personal access token. I gave this personal access token every possible permission, but again when I try to git clone the private repo, I get the following error message: remote: Repository not found.
I think the problem may be that when I go to my GitHub account and look at the tab "Repositories," I don't see this Repository. I am able to push and pull from it though.
Can anyone help me understand what is going on / help me get access in colab to this repo? I am very confused; in general there seems to be many ways to do this online, but none of them are quite working for me, and I don't understand why it's so easy to mount the Google Drive but so hard to sync with GitHub.

PyCharm GitHub error "git#github.com: Permission Denied (publickey)"

Ok about 2 hours ago I enabled the VCS as GitHub, then went in and did the Oauth (I think its called) where JetBrains opens a browser and asks me to authorize GitHub. Then I clicked admin, create a repo, add comments, add read comments, and other stuff to authorize PyCharm to create a repo and push via the app.
Now I'm still getting errors, it pushed to create a repo... but there is no code inside.
Why isn't this a simple process? I've enabled it, and setup GPG access but it refuses to sync my code.
Now under preferences>version control the directory just shows despite my project having a name and over 500 files.
Under Preferences > Version Control > Github it shows my GitHub icon, I tried login in thru the IntelliJ button and I've synced a token. Neither worked
Pycharm is supposed to be a simple way to learn to develop stuff and be integrated.
What am I missing as I'm authorized on PyCharm Professional as a student.
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I didn't find how to fix this in pyCharm, but it worked for me when I saved my private key (matching the one authorized in GitHub) in my ${HOME}/.ssh/id_rsa.
Hope it helps.

unable to push files to github - 403

So I just started off with github, I created two accounts to practice with. One as myself and another as a different user to test pushing files. This is a public repository.
So I'm able to push files with my account.
However when I use my 2ndary account and clone my repo and then try to push as a different user I get error 403. I'm using https.
I just installed the lastest git from git-scm.
In GitHub if you go to the repository settings and under the Collaborators section you should be able to add that second user. Reading that section it says that it allows push access to the repository.
HTTP 403 is "permission denied"; this clearly indicates you're either not authenticating with the right credentials, or the second user doesn't have push rights to that repo (which is the case unless you explicitely give the second user push rights).

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.