Using a repository cloned with gcloud source repos cannot find credential-gcloud.sh - osx-elcapitan

When syncing a repository in GitHub Desktop that was cloned with gcloud source repos clone <repository> the following error comes up on Mac OS X 10.11 (El Capitan):
git: 'credential-gcloud.sh' is not a git command. See 'git --help'.
2016-08-04 07:44:06.598 GitHub Desktop Login[809:15686] AskPass with arguments: (
"/Applications/GitHub Desktop.app/Contents/MacOS/GitHub Desktop Login",
"Username for 'https://source.developers.google.com': "
)
2016-08-04 07:44:06.645 GitHub Desktop Login[809:15686] Error getting keychain item for source.developers.google.com: The specified item could not be found in the keychain.
error: unable to read askpass response from '/Applications/GitHub Desktop.app/Contents/MacOS/GitHub Desktop Login'
fatal: could not read Username for 'https://source.developers.google.com': Device not configured
(128)

The reason is that the credential helper git-credential-gcloud.sh delivered with gcloud SDK cannot be found on the PATH.
Fortunately git cannot only call and detect a credential helper from the PATH, but also accepts and invokes commands when specified a full path.
Changing the credential.helper from:
credential.helper="gcloud.sh"
to:
credential.helper=/<PATH-TO-GCLOUD-SDK>/bin/git-credential-gcloud.sh
by invoking
git config credential.helper /<PATH-TO-GCLOUD-SDK>/bin/git-credential-gcloud.sh
resolves the issue for the specific repository.

Related

Q: Sourcetree error : 'git status' failed with code -1"

Sourcetree showing this error 'git status' failed with code -1" while trying access project from bookmark, also I can't clone any other project from remote list or manual by url.
SSH connection is good. Command
ssh -T git#github.com showing - Hi "name"! You've successfully authenticated, but GitHub does not provide shell access.
Command git clone also works fine and fetch project.
Resolved by clicking options > git > Use System Git and set to use System Git Version.

How to use personal github access token with gitlab runner

I mirrored a private repository from Github to run builds with gitlab runner. My project has private gems hosted on Github and the build is failing with
Fetching git#github.com:private/gem.git
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Retrying `git clone 'git#github.com:private/gem.git' "/builds-ci/gitlab/repo/vendor/ruby/2.4.0/cache/bundler/git/gem-a356dd016736a58b8b77677e8d7df689f8f43ada" --bare --no-hardlinks --quiet` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.com:private/gem.git' "/builds/gitlab-ci/repo/vendor/ruby/2.4.0/cache/bundler/git/gem-a356dd016736a58b8b77677e8d7df689f8f43ada" --bare --no-hardlinks --quiet` in directory /builds/gitlab-ci/repo has failed.Host key verification failed.
fatal: Could not read from remote repository.
I used personal Github access token to mirror private repositories from Github to Gitlab. There is a way to use Github access token to clone private gems with bundler without the need to set up SSH keys:
export BUNDLE_GITHUB__COM=x-access-token:<token>
Do I need to create a separate access token and paste it into .gitlab-ci.yml
image: ruby:2.4.1
variables:
BUNDLE_GITHUB__COM=x-access-token:<token>
...
Or I can use the token which I used to mirror repositories from Github? Like this
variables:
BUNDLE_GITHUB__COM=x-access-token:$SOME_GITLAB_JOB_ACCESS_TOKEN
?
I managed to do it with adding BUNDLE_GITHUB__COM to .gitlab-ci.yml commiting it to the source code for now:
# .gitlab-ci.yml
variables:
BUNDLE_GITHUB__COM=x-access-token:<token>
...

Jenkins workspace error on ssh&Mercurial plugin

I met this problem when I was trying to config Jenkins to fetch the repository on the server of a fellow(university course).
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/TEST1/workspace
$ hg clone --rev default --noupdate ssh://XXX#partch.anu.edu.au/XXX/XXX /var/lib/jenkins/jobs/TEST1/workspace
remote: Host key verification failed.
abort: no suitable response from remote hg!
ERROR: Failed to clone ssh://XXX#partch.anu.edu.au/XXX/XXX
ERROR: Failed to clone ssh://XXX#partch.anu.edu.au/XXX/XXX
Finished: FAILURE
Then I tried to do the same command in terminal, with the different error
abort: Permission denied: /var/lib/jenkins/jobs/TEST1/workspace
I tried to change the location for the command:
hg clone --rev default --noupdate ssh://XXX#partch.anu.edu.au/XXX/XXX /home/administrator/TEST
And it works
According to all these, and the fact that this is no workspace(Error: no workspace)--I know it's because of no successful build ever.
Is it a problem with the workspace configuration of Jenkins? but don't know what to do.
Thank you very much if anyone gives me some advice!
Your error doesn't mention anything about a workspace. There error clearly states that it comes from remote hg and it is an authentication failure.
Also, are you using the Mercurial Plugin to perform the SCM checkout or trying to replicate it with a Build Shell build step?

dotcloud push on cygwin fails with "rsync error: unexplained error (code 255)" (similar with git and hg)

Though I have followed the usual steps for using the dotCloud CLI under Cygwin, dotcloud push fails in all cases: --rsync, --hg, and --git.
I am on Windows 8 and Cygwin.
How can I push successfully?
Sample output:
me#host /cygdrive/d/project
$ dotcloud push --rsync
==> Pushing code with rsync from "./" to application myapp
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
me#host /cygdrive/d/project
$ dotcloud push --git
Permission denied (publickey,password).r from "./" to application myapp
fatal: The remote end hung up unexpectedly
me#host /cygdrive/d/project
$ dotcloud push --hg
==> Pushing code with mercurial from "./" to application myapp
abort: no suitable response from remote hg!
Error: Mercurial returned a fatal error
You may be running into a bug in Cygwin's group permissions. Vineet Gupta gives a workaround in his blog. The problem comes from the very strict permissions expected by ssh around the keys, and the solution is to set the permission on the ssh key properly (to 600, rw by owner only). Cygwin seems to need the group to be added manually.
Updating the steps to get the dotCloud CLI installed, including setting the permissions, leads to:
Start the Cygwin Setup.
Select default choices until you reach the package selection dialog.
Enable the following packages:
net/openssh
net/rsync
devel/git
devel/mercurial
python/python (make sure it’s at least 2.6!)
web/wget
After the installation, you should have a Cygwin icon on your desktop. Start it: you will get a command-line shell.
Download easy_install
wget http://peak.telecommunity.com/dist/ez_setup.py
Install easy_install
python ez_setup.py
You now have easy_install; let’s use it to install pip:
easy_install pip
Now install dotcloud (the CLI)
pip install dotcloud
Set up the CLI with your credentials. This will also download the ssh key.
dotcloud setup
New Step Update the permissions on your dotCloud key:
chgrp Users ~/.dotcloud_cli/dotcloud.key
chmod 600 ~/.dotcloud_cli/dotcloud.key
Now you should be able to dotcloud push
If you have multiple dotCloud accounts, then you will need to repeat this process for each account, since each account has its own key. Also note that you shouldn't have to set these permissions manually, but it seems like the group ownership is sometimes the wrong default in Cygwin. Linux and OSX don't seem to show this problem, though the permissions must be 600 for all OSes, so it is worth checking.

How To Upload Files on GitHub

I have recently downloaded GitHub and created a repository on it. I am trying to upload an Objective C project in it. How do I go about doing this?
I didn't find the above answers sufficiently explicit, and it took me some time to figure it out for myself. The most useful page I found was:
http://www.lockergnome.com/web/2011/12/13/how-to-use-github-to-contribute-to-open-source-projects/
I'm on a Unix box, using the command line. I expect this will all work on a Mac command line. (Mac or Window GUI looks to be available at desktop.github.com but I haven't tested this, and don't know how transferable this will be to the GUI.)
Step 1: Create a Github account
Step 2: Create a new repository, typically with a README and LICENCE file created in the process.
Step 3: Install "git" software.
(Links in answers above and online help at github should suffice to do these steps, so I don't provide detailed instructions.)
Step 4: Tell git who you are:
git config --global user.name "<NAME>"
git config --global user.email "<email>"
I think the e-mail must be one of the addresses you have associated with the github account. I used the same name as I used in github, but I think (not sure) that this is not required. Optionally you can add caching of credentials, so you don't need to type in your github account name and password so often. https://help.github.com/articles/caching-your-github-password-in-git/
Create and navigate to some top level working directory:
mkdir <working>
cd <working>
Import the nearly empty repository from github:
git clone https://github.com/<user>/<repository>
This might ask for credentials (if github repository is not 'public'.)
Move to directory, and see what we've done:
cd <repository>
ls -a
git remote -v
(The 'ls' and 'git remote' commands are optional, they just show you stuff)
Copy the 10000 files and millions of lines of code that you want to put in the repository:
cp -R <path>/src .
git status -s
(assuming everything you want is under a directory named "src".) (The second command again is optional and just shows you stuff)
Add all the files you just copied to git, and optionally admire the the results:
git add src
git status -s
Commit all the changes:
git commit -m "<commit comment>"
Push the changes
git push origin master
"Origin" is an alias for your github repository which was automatically set up by the "git clone" command. "master" is the branch you are pushing to. Go look at github in your browser and you should see all the files have been added.
Optionally remove the directory you did all this in, to reclaim disk space:
cd ..
rm -r <working>
Well, there really is a lot to this. I'm assuming you have an account on http://github.com/. If not, go get one.
After that, you really can just follow their guide, its very simple and easy and the explanation is much more clear than mine: http://help.github.com/ >> http://help.github.com/mac-set-up-git/
To answer your specific question: You upload files to github through the git push command after you have added your files you needed through git add 'files' and commmited them git commit -m "my commit messsage"
You need to create a git repo locally, add your project files to that repo, commit them to the local repo, and then sync that repo to your repo on github. You can find good instructions on how to do the latter bit on github, and the former should be easy to do with the software you've downloaded.
To upload files to your repo without using the command-line, simply type this after your repository name in the browser:
https://github.com/yourname/yourrepositoryname/upload/master
and then drag and drop your files.(provided you are on github and the repository has been created beforehand)
Here are the steps (in-short), since I don't know what exactly you have done:
1. Download and install Git on your system: http://git-scm.com/downloads
2. Using the Git Bash (a command prompt for Git) or your system's native command prompt, set up a local git repository.
3. Use the same console to checkout, commit, push, etc. the files on the Git.
Hope this helps to those who come searching here.
if you're on windows:
http://windows.github.com/
otherwise:
http://git-scm.com/downloads/guis
If you want to upload a folder or a file to Github
1- Create a repository on the Github
2- make: git remote add origin "Your Link" as it is described on the Github
3- Then use git push -u origin master.
4- You have to enter your username and Password.
5- After the authentication, the transfer will start