Github: Repository not found - github

$ git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
I'm quite sure the repository is there and I added it correctly. The problem may be that I am using two github accounts. One is my personal one and one is for a client. I'm trying to get it on the client's github as a private repository.
I am able to create a repository and push it to my personal github account. But I can't get it to push to my client's account.

You probably do not have permission to push to your client's repository. To get access, the easiest way would be if your personal GitHub account had access to your client's repository.
Ideally your client's account is a GitHub Organisation. That way, an arbitrary number of people can be given permission to access its features. Just add any account as an owner of the organization, or add an account to a team to give access to specific repositories.
If your client's account is not an organisation, you can give yourself access by adding your own account as a collaborator to the repository (in the repository admin settings). That gives you access to the repository from your own account.
If you are trying to use multiple ssh keys to login to different Github accounts depending on which repository you are pushing to, see Multiple GitHub Accounts & SSH Config. However, this is more difficult and is probably unnecessary.

Related

Can sync 2 GitHub accounts together? Enterprise to personal?

I have a GitHub Enterprise account from school and I have a personal GitHub account. Throughout my course I have been uploading all of my projects to the enterprise account and although I am told I would have "lifetime" access to said enterprise account, I would still like my work to be attached to my personal account.
Is there a way I could link or sync both of my accounts together? Or a way if I push a repo to my enterprise account it will also push to my personal account at the same time?
The answer is yes, you can push your repo's to multiple GitHub accounts. When you first pull from an account, you have access to said account until further notice, even after you exit your terminal. All you need to do is to push your files to the "main" branch of each GitHub account.
For example. My schools repo main branch is not called "main" it is called "master." So after all the commits I would just git push origin master . This will push it to school. My personal account however is named main. So right after I push to my school I can just git push origin main and it will push it to my personal. Using these two back to back works just fine and it does not matter which one you use first.

Pushing files from one account to other in github

Iam trying to push some changes to other account from another account but it is giving me permission error.I checked the github settings but everything there seems to be right.Can anybody help me with this?
EDIT:
I tried changing my user name and email too still it is giving same error
Some info about the transfer process which might help you
When a repository is transferred between two user accounts, issue assignments are left intact. When you transfer a repository from a user account to an organization, issues assigned to members in the organization remain intact, and all other issue assignees are cleared. Only owners in the organization are allowed to create new issue assignments. When you transfer a repository from an organization to a user account, only issues assigned to the repository's owner are kept, and all other issue assignees are removed.
If the transferred repository contains a GitHub Pages site, then links to the Git repository on the Web and through Git activity are redirected. However, we don't redirect GitHub Pages associated with the repository.
All links to the previous repository location are automatically redirected to the new location. When you use git clone, git fetch, or git push on a transferred repository, these commands will redirect to the new repository location or URL. However, to avoid confusion, I strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using git remote on the command line:
$ git remote set-url origin new_url
Add the collaborator from the initial account (the git account having the repo) and the second account can accept the invitation to be a collaborator
This allows you to change and push the code from different Id also.

GitHub private - collaborator cannot access the repository

One of our users create a private repository within and organisation on GitHub Enterprise. He added a collaborator, but this person get 404 error when trying to access the repo. I added my account to this repo and all works fine for me.
Added collaborator is in the same organisation, repo is visible on his profile, link to repo is fine too (it works for me and repo owner).
I was searching the answer in Internet, but no luck.
Do you have any idea, what can cause this situation?
This usually happens because the user who is having an issue's client isn't properly authenticating.
You can read more about it here: https://developer.github.com/v3/troubleshooting/

Having separate GitHub and Bitbucket Accounts on the same machine

Now while this can be considered duplicate at the first glance, I request everybody to please go through the description.
I want to push to separate Bitbucket and GitHub accounts.
While I understand that we can have a global config (say its the primary account - Bitbucket) and a local config for a repository (GitHub) after setting separate SSH-keys for both, is there a way we could configure multiple email-id's/userNames in the .gitconfig file ?
Note: I have separate emails/username's for the GitHub and Bitbucket account.
Any help would be appreciated.
You can have multiple ssh keys setup for pushing to multiple repository hosting services (like I describe in "Use SSH keys from command line during push for GitHub?")
But if you want to push to GitHub and Bitbucket from the same local repo (one commit, 2 pushes), then you would need to chose one username/email for your commit, which can only have one set of author/email metadata associated to it.
If you are pushing from different repo, then yes, each one can have its own local Git config setting, with different user name/email.

How to access private repositories on Github and Bitbucket without permission of admin

So, my question is:
How to access private repositories of Bitbucket/Github or any other online web-based version control repository hosting service.
Any feedback is most welcome.
Thanks
Steve Washer
I'll only speak for github as a daily github user. The only way to access them is either by being member of the repository or outside collaborator of the repository. Owner of the repo can add you to it in the repository Settings.
Another way is to ask any of the members to provide you the personal access token, which you could use to read the repository via the API. This is however, unsafe.
Yet another way is asking the repository owner or any repo user to add your public SSH key to his account so you may have repo access (clone, commit) without ability to view it on github.com
Summary: you always need to talk to the owner or any of the current repository members. Private repo will never be accessible otherwise.