i want to commit changes to GitHub
i can do it with GitHub desktop but i get this error when i try with android studio commit changes button :
"Failed with error: fatal: unable to access 'https://github. ... .git/': The requested URL returned error: 403"
You need to first find the correct SSH/ HTTP address to the repository that you would like to commit to then you can run this command in your terminal:
git remote add origin [remote repository URL]
once connected, you should be able to commit the changes.
Related
i´m trying to make a task in Gradle for my Android project ( using Kotlin DSL ) where I need to do an automatic pull for my "develop" branch.
This are the commnand I want to run :
git pull origin develop:develop
In the terminal this works just fine.
I`m using "commandLine" with "exec" in my gradle file and I´m having this error message:
code:
tasks.register<ReleaseTask>("makePull") {
exec { commandLine("git", "pull", "origin develop:develop") }
}
error message:
ssh: Could not resolve hostname origin develop: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
FAILURE: Build failed with an exception.
I don´t have any issue if I try this commands in the terminal, do you know what i´m doing wrong ?
You haven't separated the origin and the develop:develop arguments in the gradle version. Use this instead:
commandLine("git", "pull", "origin", "develop:develop")
I'm getting the following error while trying to push or pull or anything with ssh in android studio 3.6
Update failed Invocation failed Unexpected Response from Server: Unauthorized java.lang.RuntimeException: Invocation failed Unexpected Response from Server: Unauthorized at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNativeSshAskPassXmlRpcClient.java:34) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassApp.main(GitNativeSshAskPassApp.java:30) Caused by: java.io.IOException: Unexpected Response from Server: Unauthorized at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(LiteXmlRpcTransport.java:231) at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(LiteXmlRpcTransport.java:90) at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178) at org.jetbrains.git4idea.nativessh.GitNativeSshAskPassXmlRpcClient.handleInput(GitNat..................
looks like the problem is with native ssh and we cannot change it to built-in like previous versions... how to fix this ???
any help would be appreciated
WORKAROUND:
1. In Android Studio go to Help - Find Action - Registry...
2. Find git.use.builtin.ssh and enable it
3. Check that git works again
Not straight solution - but you can change your git url from ssh to https, and it will work.
git remote set-url origin YOUR_REPOSITORY_HTTPS_URL
I have found an alternative way to make SSH actually work...
rate up if it worked for you!!!
using putty plink for ssh instead of the Git ssh(openSSH)
1.set the system env-variable GIT_SSH and let it point to plink.exe
download links available here: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
2.start pageant and add your private key to it (needs to be converted to another format to be used)(use puttygen to convert id_rsa to ppk)
3.use command in terminal based on github or gitlab : plink -v git#github.com or plink -v git#gitlab.com
congrats now you can work with ssh
I am using Github to sync my Android Studio Project.
I have been able to commit and push successfully for over a month.
After adding some files, I received this error.
12:44:45 PM Push failed: fatal: repository 'https://rrtigga#github.com/rrtigga.GetDisciplined1_0.git/' not found
However, the repo exists...
Here is a snippet from my terminal:
Rohits-MacBook-Air:GetDisciplined1_0 Spicycurryman$ git remote add origin rrtigga#github.com:rrtigga/GetDisciplined1_0.git
fatal: remote origin already exists.
Rohits-MacBook-Air:GetDisciplined1_0 Spicycurryman$
This is kind of an awkward error... I did some research and was unable to produce a solution.
GitHub: ERROR: Repository not found. fatal: The remote end hung up unexpectedly (different from similar posts apparently)
EDIT: It really exists:
https://github.com/rrtigga/GetDisciplined1_0
What is the problem here and how can I fix it?
You have a remote called origin which is configured to point to https://github.com/rrtigga.GetDisciplined1_0.git/, which is not the correct URL for your repository. You should be using either https://github.com/rrtigga/GetDisciplined1_0.git for access over HTTPS, or git#github.com:rrtigga/GetDisciplined1_0.git for SSH.
The error "remote origin already exists" means what it says: you're trying to add a remote with the same name as one that already exists. You need to either delete it first with git remote rm origin, or use git remote set-url to change the URL of the existing remote.
I am trying to download android_4.2_r1 source code. And I am using Ubuntu 12.04. I've installed jdk 1.6, Python 2.7, Git..
I downloaded repo use this code "$ curl http://code.google.com/p/git-repo/downloads/detail?name=repo-1.12 ~/bin/repo" (Since the official one is forbidden in China... )
Anyway, I initiated repo successfully.
But when I try to 'repo sync' I meet the error:
brendon#brendon-Lenovo:~/android4.2/.repo$ repo sync
fatal: remote error: access denied or repository not exported: /platform/abi/cpp.git
error: Cannot fetch platform/abi/cpp
Does Anyone know the reason? Thank you!
It is because some fetch link is forbidden in China...
We just need to choose the one that can be used here.
I recommend this one: git://Android.git.linaro.org/
I am using repo to sync my local android source code. I have followed the instructions on the android source website: http://source.android.com/source/downloading.html
When I try to do repo init:
repo init -u http://android.googlesource.com/platform/manifest
I get the following error:
fatal: Cannot get http://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error unknown url type: https
I have followed multiple threads on google and have modified my repo scripts and changed the https to http in the REPO_URL but I am continuing to get the same error.
What else do I need to do?
Please help.
Markus
I have answered my own question.
Since I last did a repo sync I had cleared my HTTP_PROXY and HTTPS_PROXY variables.
export HTTP_PROXY=http://<proxy_user_id>:<proxy_password>#<proxy_server>:<proxy_port>
export HTTPS_PROXY=http://<proxy_user_id>:<proxy_password>#<proxy_server>:<proxy_port>
Running this for my company settings fixed the problem.
Markus