Git-remote-https permission denied - android

I am using Android terminal IDE and I am trying to pull the master branch into my phone. I have done the following:
git config --global user.name "name"
git config --global user.email email
git init
git remote add origin http://github.com/blahblahblah
git clone https://github.com/blahblahblah
Typing git status gives me nothing to commit (on branch master). When I typed the last line above it gives me:
Cloning into 'blah'...
fatal: cannot exec 'git-remote-https': Permission denied
Thanks for helping!
Edit: This question is not identical to the other one because the other one has the wrong url. I am sure that I have the correct url.

Related

remote with selected name already exist Android studio , git hub error

I'm getting this GitHub error in android studio whenever I'm creating a new repository , And I'm not having any GitHub repo. of the same name.
goto Terminal in android studio and type below command –
git remote rm github
Open to Android Studio > VCS > Git > Remotes Delete all the addresses that will appear in this section. The problem will solve.
Android studio->Git->Manage Remotes...
And delet all from there with -
Tried it.....
Step1. Git-2.11.0-64-bit.exe Setup.
Step2: Git Bash -> git config --global user.name "your userName",
git config --global user.email "your email".
Step3: Android studio->File->Settings->GitHub-> login "your email"
Password "your password" -> test
Step4: VCS->import into version control->share Project.
Step 5: Successful.\
Git $ git remote rename
New repository name: eDiot1
Remote name github1

git push -u origin master remote: Permission to user android studio

I was changed user for github in Android studio and trying to pushing code in repository but its getting error.
Repository successfully creating and commit also but in pushing time getting error.
F:\....>git push -u origin master
remote: Permission to abc.in/abc.git denied to olduser.
fatal: unable to access 'https://..../abc.git/': The requested URL returned error: 403
I also tried new project, but still getting old user name denied access error.
Why don't you push using Android Studio?
Have you got write permission on remote for new user?
Did you changed user in repo too? I think that you still have old data. Check it in project directory
git config user.name
git config user.email
You can check this trick
edit .git/config file under your repo directory
find url=entry under section [remote "origin"]
change it from
url=https://your_user_name#github.com/yy/repo_name.git
to
url=ssh://git#github.com/your_user_name/repo_name.git.
Alternatively
Create new repo in your remote server <- can be skipped
Remove existing git remote from local project
git remote rm origin
Add new remote
git remote add origin https://github.com/your_user_name/repo.git
I have no more idea :)

GITHUB Push failed: Failed with error: fatal: unable to access

Before, i user A account to push code on Android Studio.Now i logout and change into B account to Push.
When pushing error occur:
Push failed: Failed with error: fatal: unable to access 'https://github.com/thangcoder/demo.git/': The requested URL returned error: 403
And below error when i push in command:
$ git push -u origin master
remote: Permission to thangcoder/demo.git denied to trangchongcheng.
fatal: unable to access 'https://github.com/thangcoder/demo.git/': The requested URL returned error: 403
(trangchongcheng is A Account)
Please for me sugest, thank all.
I got the same error. Here's how you fix it.
The problem was that your git repository was secured with SSH keys.
Login to GitHub > Your repository for the project > Settings tab > Deploy keys
Delete the key/keys assigned for your Desktop.
And try pushing the repository from Android Studio again.
For pushing a repository refer: "How to use GitHub with Android Studio".
This worked for me!
It's clear you do not have write permission on repo. Please ask thangcoder to add write permission to you.
Check that your computer has permission to push to that repository.
Here's how you can check:
Login to your github account and direct yourself to this link:
https://github.com/settings/keys
Now do you see your machine listed on that link? If not add a key to enable your machine to push to a remote repository.
Here's how you can add a key:
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
change your file .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://你的github用户名:你的github密码#github.com/Pandaring/Demos.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
i had this problem, please do this way:
1.git config --global --unset user.name
2.git config --global --unset user.email
3.git remote add origin https://github.com/username/file.git
4.git push -u origin master
after push github asks you username and password from user B
I just had the same problem, finding a solution was time consuming.
Actually reading the error is helpfull:
Push failed: Failed with error: fatal: unable to access
well, thats the point. just add the user as an collaborator to the repository.
https://help.github.com/articles/inviting-collaborators-to-a-personal-repository/
Note: adding the user to the organization is not enough.

Push to private repository after clone from another repository fork

I am completely new to Github...
I have been learning Android from udacity and I cloned one of the forks from the public repository.
Now, I want to create my own private repository and push the files to it but it always tries to push them to the udacity repository instead of mine.
Here are the commands I used:
git remote add origin <my_git_url>
git add .
git commit -m "First Commit"
git push origin master
But it just keeps returning this:
remote: Permission to udacity/Sunshine-Version-2.git denied to xxxx.
fatal: unable to access 'https://github.com/udacity/Sunshine-Version-2.git/': The requested URL returned error: 403
Please help....
The error says you don't have rights to push there.
Most probably, you have to fix your repository url.
git remote remove origin
git remote add origin https://github.com/your-username/your-repository
git push origin master
Then it will ask you to provide the credentials. Later you can get rid of that using SSH urls. Here is a nice article on how to get started using SSH keys.

GitHub on Android Studio

I have a main GitHub account shared by multiple people, and we each have our own account. I created a repository through Android Studio using the main account, and now I was to push code from my personal account. So I go to the GitHub settings under File > Settings and change the login credentials to reflect my personal account. However, when I push the code it still says the commit was made by the main account, and that it is the only contributor. What am I doing wrong?
Maybe when you set up git with your new account it didn't change gitconfig
Try:
git config --global user.name "Amir"
git config --global user.email "your_email#example.com"
(note --global is optional , it will make it your name/email everywhere on the system)
Indeed, the solution by #LeonardoC solves the problem, but if you want to know why this was happening you can read this: https://help.github.com/articles/why-are-my-commits-linked-to-the-wrong-user/
Particularly, the part that says:
GitHub uses the email address in the commit header to link the commit to a GitHub user. If your commits are being linked to another user, or not linked to a user at all, you may need to change your local Git configuration settings, add an email address to your account email settings, or do both.
Note: If your commits are linked to another user, that does not mean the user can access your repository. A user can only access a repository you own if you add them as a collaborator or add them to a team that has access to the repository
So, to change your local Git configuration settings you type the two instructions aforementioned by #LeonardoC:
git config --global user.name "yourUsername"
git config --global user.email "theEmailLinkedToYourUsername"
And just in case you want to check what are the values before changing them, you can get them by just typing in the shell:
git config --global user.name
git config --global user.email

Categories

Resources