Currently using install_git() to install from a repo protected by Azure Active Directory results in an error:
> devtools::install_git("https://myteam.visualstudio.com/MyProject/_git/MyAwesomeRPackage")
Downloading git repo https://myteam.visualstudio.com/MyProject/_git/MyAwesomeRPackage
Installation failed: Error in 'git2r_clone': Unable to authenticate with supplied credentials
even though the AAD credentials are stored in the git credential manager. For example, calling this from the command line works just fine:
git clone https://myteam.visualstudio.com/MyProject/_git/MyAwesomeRPackage
is there any way to have R use the credentials from the git credential manager for this install?
Try the git parameter, e.g., git = "external".
Related
I'm trying to push my files to my GitHub, but I'm getting the following error:
error: cannot run rpostback-askpass: No such file or directory
fatal: could not read Username for 'https://github.com': Device not configured
Details:
I'm using MAC
My git version: git version 2.32.1 (Apple Git-133)
I'm linking my project to GitHub with HTTP protocole
I ran git config --global user.name and user.mail in the terminal in Rstudio
I tried to use the solution of running git push -u origin main and when I type in my credentials, it gives me the error: "authentication failed". I never changed my password to GitHub, I checked it today to enter the website, it works.
I tried using ssh protocol instead but it seems to be giving me even more errors even though I created my ssh key and added it successfully to my GitHub. Specifically when I click on create new project and add the ssh link Rstudio says:
Cloning into 'data-science-hw'...
ssh_askpass: exec(rpostback-askpass): No such file or directory Host key verification failed.
fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I went through all the possible suggestions I could find on the internet but none of them worked. I also tried linking a token generated by git, but it work either.
I would be very happy if anybody has any idea what else I could try..
I have made my private repository public so my SMTP server blocked my account because I had the API KEY inside one of the files (.env - it is a Symfony project).
I followed the steps on git hub Remove sensive data to remove sensitive data up until step 8 included.
All the commands were executed on the cloned repository (I am not even sure if this was correct).
The cloned repo and github repo is clean of sensitive data.
On my remote server (Scaleway) I had deleted a file before doing these steps (mistake).
Remote server :git status gives me this :
On branch master
Your branch and 'origin/master' have diverged,
and have 84 and 84 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: public/uploads/images/logo_linxea-5f82e58f42913.png
no changes added to commit (use "git add" and/or "git commit -a")
If I try on remote server git rebase -- interactive as suggested Here I get the following :
Cannot rebase: You have unstaged changes.
Please commit or stash them.
Questions:
I am not sure if I have to continue working now on cloned repo (on local), original local repo or Remote repo for the steps 9 and 10.
How to sync the remote repo with github repo, and the local original repo with the github repo without resending all the removed sensitive information.
I need to keep the .env file on the Remote Server so my emails keep working.
Well I tried something seems to work
On Remote Server :
git reset --hard HEAD
Then
git clean -df
Then
git rebase --interactive (where I just exited) Got this message:
Successfully rebased and updated refs/heads/master.
Then recreated .env file on remote server because it was deleted in the process
I'm following instructions from https://firebase.google.com/docs/crashlytics/get-started-ios?hl=es-419
At this point:
$ pod repo add crashlytics git#github.com:crashlytics/SpecsEAP.git
I'm getting this error:
Cloning spec repo `crashlytics` from `git#github.com:crashlytics/SpecsEAP.git` [!] /usr/bin/git clone git#github.com:crashlytics/SpecsEAP.git -- crashlytics
Cloning into 'crashlytics'... ERROR: Repository not found. fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
I've checked the connection to GitHub:
$ ssh -T git#github.com
Hi Username! You've successfully authenticated, but GitHub does not provide shell access.
I've also checked I have a valid SSH key:
$ ssh-add -l -E md5
4096 MD5:b0:26:2f:78:55:57:51:0f:71:17:6d:93:15:dd:67:a8 myemail#gmail.com (RSA)
What am I missing?
Check the english version of the docs, those do not mention any of those repo-adding commands: https://firebase.google.com/docs/crashlytics/get-started?platform=ios
Looks like the spanish translation is outdated.
My colleague & I are starting on a R project, we both would be working simultaneously & interchangeable components of the model we are building. We can not use Git, as we do not want to put our code online, also it is not allowed by the organization. We also do not have a server of our own, what we have is some common shared drive. Is there a way, we can use a tool like Github/SVN completely locally, where both of us can push our code.
There are two options you can manage your R project with git repo.
Option 1: setup remote git repo in the shared directory
You can setup a remote git repo in the shared directory, and then add the remote repo as a remote for your local git repo, then you can push and push from the remote git repo. Detail steps as below:
First, in an empty folder of the shared directory (assume in \\share\path\gitrepo), execute:
git init --bare
Then add the remote repo as a remote for the local repo you are working.
Assume the local git repo (R project) is opened in R Studio, so you can add remote in R Studio terminal window or through git command line:
git remote add origin \\\\share\\path\\gitrepo
Note:
The count of slash \ in the remote repo url.
And the pull and push button is still disabled after adding remote repo since the local branch (maste) has not tracked the remote branch (origin/master).
Then you can commit changes and push to remote repo first time by:
git push -u origin master
After that (local master is tracking origin/master), the pull and push button will be enabled after refresh the git tool bar. And can pull/push by clicking the buttons afterwards.
Option 2: host the remote git repo to third-party private repo
If it’s ok for you to hosted your git repo to third-party, and do not let everyone has read permission, then you can create a private git repo in the third-party organization.
For bitbucket, it’s free to create private git repos, so you can host your git repo there.
I am in the process of installing Jenkins to push changes made to a Github repo to a "live" repo on my server.
I have installed Jenkins on my Ubuntu server and using its web interface I have installed the Github, Git and Github API plugins. I've also created a build task in Jenkins which runs some shell commands when Github detects that a push has been made to its repo.
The commands are running but I seem to be hitting a permissions issue. I get the following error in the Jenkins Console:
+ git pull origin master
error: cannot open .git/FETCH_HEAD: Permission denied
Build step 'Execute shell' marked build as failure
Finished: FAILURE
The parent directory for the site (and all its subdirectories) is owned by a user "james" who belongs to a group "sudo". Jenkins has its own user "jenkins" who I have since added to the group "sudo". As "jenkins" and "james" are both "sudo" members and the group has permission to write, I am unsure why this error would be occuring?
Adding a user to the group sudo does not make that user member of the same group as the one protecting the .git folder.
It just allows jenkins or james to be added to the sudoers, and executing commands (specified in said sudoers) as root.
You need to check which group is protecting .git, or if it is the root group, modify the jenkins script in order to sudo git pull origin master.
The OP James Howell confirms in the comments:
I ended up changing the group owner of the directory to "jenkins" of which the jenkins user is already a member.