I'm trying to push some edits from personal proyect to my repository and requires me my username and pass, i write them but the console show me something like:
fatal: authentication failed
I didn't make any mistake writing my username and pass, so I tried to figure out and I think this is for the two-step authentication that i have on my github account. Someone knows how to solve that?, I'll be glad.
Like #NickStoughton mentioned in the comments, SSH is probably the best way to do this.
Here is the fixed version of his link:
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Related
I am working on my android studio codes in kotlin and trying to push them into my GitHub repository. I have watched many videos and all of them show the same steps of downloading the Git and adding VCS and then adding the code and finally committing it, here is the video link: https://www.youtube.com/watch?v=GhfJTOu3_SE
The issue is, once I click on the push button it asks me to log in to my GitHub Account in order to complete the procedure and once I enter the Github username and password it keeps on loading and never redirects to anything.
I try to create accounts in the JetBrains, bitbucket or any other software that can help me to access the authorization for the GitHub and upload the code but nothing works.
Is there something I am missing? I am unable to detect the issue here.
Thanks to AthulMuralidhar for the suggestion in this comment:
i suggest to try to do it in the terminal first - github recently changed their policy to not allow username + password logins. They now prefer only ssh based logins
I just solved the issue by logging into the github account through android studio settings, looking for github and adding my github account.
It no longer asks for permission and directly commits the code into the repository.
I'm new to SQLFluff and am interested in a pre-commit check of changed files for rule violations. SQLFluff is working correctly, and to get it working with pre-commit I'm following the guide found here, but am confused by pre-commit asking for git credentials before doing anything.
After entering a commit message, I see:
[INFO] Initializing environment for *my gitlab URL*
Username for '*my gitlab URL*':
My org does everything through SSO so I don't have the password to give. No guide or blog post detailing the set up of pre-commit (at least that I can find) shows or says anything about credentials or configuring authentication. Running pre-commit against a file using a terminal command yields the same result. From what I understand, the provided SQLFluff hooks are client side, so I don't know why authenticating to gitlab would be necessary. I feel like I am missing something obvious, but I've done my searching and came up short. Much thanks to anybody who can tell me what I'm missing!
In my case when trying flake8 on pre-commit, I had same issue, my configuration file was trying to get the repo from gitlab. Changing that to github solved the issue. Hope that would help!
I forked application to android studio and when I try to make a pull request:
I get :
Can't Create Pull Request
Push failed:
failed to push some refs to 'https://github.com/projectname.git'
What is the right way to do that?
Note :
I can commit and update my projects but I can't make pull request to other projects.
This is obviously an authentication problem. There are WAY too many unknowns, so I doubt anyone can give you a definitive answer. Here are the steps to investigate in order to solve it:
Is your GitHub Account authenticated with your Android Studio installation? Check your Android Studio Settings.
In order to authenticate you need to generate an Access Token through your Github account settings and use that token as seen in the picture above. When generating a new token, normally I would advise you to be careful with the permissions you grant to it. For debugging your issue, generate a new one with full access to everything and delete it as soon as you resolve your issue.
Last, if both of the above steps are done correctly and you still can't open a PR. Make sure the repository you trying to open a PR on, allows third party users to perform such actions.
NOTE: You can always commit code in your local repository. That lives in your local environment (a.k.a. your computer) and you have full permission to do whatever you please with it. That doesn't mean the changes you do locally, will be reflected in the remote repository (a.k.a. the one hosted at Github servers).
First you need to install git client and configure with Android studio then you need to enable git into android studio from VCS option. and then you can see on toolbar 2 icon will come for push and pull request.
by these two option you can do pull and push very easly.
please have look this.
http://prntscr.com/hgvbxw
reference-https://javapapers.com/android/android-studio-git-tutorial/
While trying to clone a repository from gitlab, I ran into the following error:
git clone <USER>#<URL>:<path_to_project.git>
Cloning into 'xxx'...
<USER>#<URL>'s password:
fatal: 'root/acl-labl-website.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I tried both the SSL and HTTP address, and both got this similar error. Not sure what it meant, and after many tries involving modifying config files (from gitlab, nginx, apache checking redirects, etc.), I found the very simple answer. Still not sure why my other method didn't work, but I found that first adding your public ssh key to gitlab (through the GUI), then using the same command as above, but using git instead of my username:
git clone git#<URL>:<repo_path>.git
worked. I.e. generate your id_rsa.pub as explained here: https://docs.gitlab.com/ce/ssh/README.html , copy this to your ssh keys (which in my case was one of the tabs in the gitlab GUI; I've done this before for git as well, where it's also to be found somewhere in your user settings). In my case I had to run
ssh-add
still before it worked, but with a colleague it worked without as well.
Then the cloning using git# instead of username# worked perfectly. Again; still not sure why it won't work using my username and password (same as the one I use to login to the gitlab GUI), so if someone could shed some light on that, I'd be interested in it. But since it took my quite some time before I found this solution/work-around, thought I'd post it here. Perhaps better suited to serverfault actually, but since I suspect many people end up here as well, perhaps the admins can live with this post here :)
I searched through Google, forums and JGit user guide but couldn't find how to connect to a distant repository with the API.
Anyone has an example or just an idea on how to do that?
Thanks for your help.
Currently, JGit 2.0.0-SNAPSHOT does only offer
org.eclipse.jgit.storage.file.FileRepository
org.eclipse.jgit.storage.dfs.InMemoryRepository
concrete Repository classes, meaning that since org.eclipse.jgit.api.Git takes a Repository, it is not possible to work remotely. Since Git by itself is not designed to operate remotely in the way I think you mean, I doubt we will see such a feature any time soon.
MORE ON THAT:
Consequently, you will need to clone locally. You do that by issuing
Git.cloneRepository()
.setURI(myRemoteURIString)
.setDirectory(new File(myLocalPathString))
.call();
However, for reasons of consistency in Git you should clone a bare repository only, so a non-bare repository in a remote location, while not technically, is practically inaccessible.
I am not sure I understand the question since Git is made for accessing other repositories, this is what is meant by "Git is distributed".
If you want to connect to ONE distant repository, then yeah you should clone it.
I don't know if that is what you are looking for, but you can also use multiple remotes. Adding one more is done with Git using git remote add <remote_name> <remote_uri>. As for Jgit, I unfortunately can't remember the code to do it simply, but you can figure this out.
At least it's possible by modifying the configuration, calling getConfig() from a Repository object and then calling setString(...) on it - don't forget to save the configuration in the end. But before modifying the configuration, I think you should first get to know more about Git and JGit.
I recommend you to read more about it, and play a bit with your repository. Take a look at this article : http://caiustheory.com/adding-a-remote-to-existing-git-repo .
Another one that will help you down the road is How do I do the equivalent of “git remote update” with jgit?
Maybe someone else knows exactly which commands to run and can help.