I could commit to this repository without problem with Xcode 6. git still works fine in terminal, i can commit both locally and to the remote. In Xcode 7, I can commit locally but not remotely. it says authentication fails and it is impossible to reset the username. (it's greyed out). I have the proper username in my local git config file. I've also tried to create a new account but I end up with the same problem of not being able to enter the userName.
my git config --local --list
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=git#bitbucket.org:myUserName/myProject.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.failedTryToRename.remote=origin
branch.failedTryToRename.merge=refs/heads/master
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.master1.remote=origin
branch.master1.merge=refs/heads/master
user.name=myUserName
user.email=myUserName#gmail.com
The problem is that you are using the SSH remote URL:
remote.origin.url=git#bitbucket.org:myUserName/myProject.git
You will need to switch to the HTTPS remote URL.
git remote set-url origin https://bitbucket.org/myUserName/myProject.git
Alternatively, just give up. Stop trying to use Xcode's internal git management. (It's pretty terrible, so no harm done.) If you want a GUI, use SourceTree; it's from the same people who give you Bitbucket and works with it beautifully.
Related
This may seem like a bit of a rudimentary issue, but I cannot seem to push from Sourcetree (windows) to a bitbucket repo for which my user is the owner.
To clarify I can log in to the repo using my browser just fine but when I push to it from Sourcetree and I enter the same details into the prompt box it fails to authenticate. I have tried using the username and email, I've even changed the password of the account but still no joy.
I also created an app password and tried using that as the password with combinations of the username and email, but no joy.
the error I am getting is:
git -c diff.mnemonicprefix=false -c core.quotepath=false
--no-optional-locks -c credential.helper= -c credential.helper="C:/Users//AppData/Local/ATLASS~1/SOURCE~1/GIT_EX~1/GIT-CR~1.EXE"
push -v --tags origin master:master fatal: HttpRequestException
encountered. An error occurred while sending the request.
remote: Invalid username or password. If your organization manages
your account or you've enabled two-step verification, create an app
password to log in: https://confluence.atlassian.com/x/9DJmMQ fatal:
Authentication failed for
'https://#bitbucket.org//.git/'
Pushing to https://#bitbucket.org//.git Completed
with errors, see above.
Any advice would be greatly appreciated
Try to add a new SSH key via Sourcetree, seems like Sourcetree is not picking up your username and password when you are using HTTP/S authentication, it can be because:
You have not added your account info in git global
You have not properly assigned credentials
Using SSH is a far preferred way:
https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html#SetupanSSHkey-ssh3
I deleted:
C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\passwd
C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\accounts.json
Inspired by this article: https://community.atlassian.com/t5/Sourcetree-questions/Getting-quot-fatal-Authentication-failed-for-quot-error/qaq-p/624663
It worked. When I restarted SourceTree it acted like it was the first time it was opened (downloaded some tools, asked me for my credentials). Once it finished, my project tabs were there, and I was able to pull/push.
Perform below steps:
Reset your password : https://id.atlassian.com/manage/change-password
Run below command from working copy
git remote set-url origin Your-repository-url-here
In order to get it worked I ended up going to Tools -> Options -> SSH Client configuration and changing it to OpenSSH. and set the path to the already generated ssh key file like C:\Users<user>.ssh\id_rsa.
In order to fit iOS 10,I have to update these 3-part in cocoaPods,so I had updated the cocoaPods to it's newest version.APP works fine,but when I use git push, the terminal require me to input username and password for github,however,the terminal showed:
fatal: Authentication failed for 'https://github.com/CocoaPods/Specs.git/'.
I am sure the username and password I put into is right.
Before I asked this question here I had ask for help on Google and find a solution:Pull first,then push.
But the embarrassing thing is that I had commit my code.That is to say,if I use git pull I will lose all my work today,that's terrible,so I wonder if there any better way to solve it.
When I hit git remote -v in terminal there showed something interesting:
origin https://github.com/CocoaPods/Specs.git (fetch)
origin https://github.com/CocoaPods/Specs.git (push)
I am surprised about how cocoaPods changed my project's remote url?
Finally I use git remote set-url origin xxx solve this problem.
when I am trying to clone a rails app repo I have got permission to, I am getting this issue.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Even after adding public key by generating one, I am unable to solve this.
Although I am able to clone using he https method but after making changes, the same error comes while I try to push the code.
Please suggest an answer for this.
First, cd into your .ssh directory. Open up the terminal and run:
cd ~/.ssh && ssh-keygen
Second, you need to copy this to your clipboard:
cat id_rsa.pub | pbcopy # On OSX
cat id_rsa.pub | xclip # On Linux
Third, add your newly generated ssh key to your account via the github/bitbucket website (just paste there).
Next, setup your git config:
git config --global user.name 'your_user_name'
git config --global user.email 'your_email'
Finally, restart your command line to make sure the config is reloaded.
Now, you should be able to clone and push from/to your github repository.
For more information on this, see this github page or this bitbucket page.
When attempting to clone, push, or pull over SSH with Git, you may receive one of these messages if Bitbucket couldn't authenticate with the keys that your SSH agent offered.
Here are the most common reasons why you may see these messages:
You used sudo when attempting the connection
You shouldn't use sudo when cloning, pushing, or pulling because the ssh-agent runs on the user level, not the root level.
Your public key isn't loaded into Bitbucket
To check if your public key is loaded into Bitbucket, do the following:
From Bitbucket, choose Personal settings from your avatar in the lower left.
The Account settings page displays.
Click SSH keys.
The SSH keys page shows a list of any existing keys.
If you don't have any keys listed, you can follow our Set up an SSH key documentation to set one up.
Your key isn't loaded into your SSH agent
If your SSH agent doesn't know to offer Bitbucket a key, the connection fails. You may run into this issue if you've recently restarted your system.
You can refer to this Article for more informations:
https://support.atlassian.com/bitbucket-cloud/docs/troubleshoot-ssh-issues/
Check few things.
Is the generated new key is the one your ssh agent using when trying to ssh to server.
(Your ssh agent might be using a different key than the one you generated)
use this to list currently loaded keys by agent.
ssh-add -L
You properly added public key to your repository hosting location.
The keys corresponding to above 1 and 2 should match.
Please see this article: GitHub: Generating SSH Keys. What happens when you run:
ssh -T git#bitbucket.org
?
You may have added the wrong key to authenticate with.
I faced this error when I created another repository in my local. My ssh-keys were already set up and I was trying to push code through vs code.
The issue got resolved when I git push-ed through git bash like I was doing before.
For bit bucket I think I have tried everything with ssh. I have tried the answer from this stackoverflow question as well. But it doesn't work. So finally I just changed the clone command from SSH to HTTPS and it worked. Only then it asked for password for my account.
I have stupidly named a new web_app the same name in my ruby on rails directory.
And now I tried to look back the "blog" in the browser, all is gone.
Now, I have a copy of the application in git repository.
Is there anyway I can pull it down to the command prompt in my computer?
Hope someone can advise me how to.
I have so far tried git pull origin master and the rails command prompts only said master -> Fetch Head
But, still nothing shows up in the browser when I type localhost:3000 etc..
Thanks.
You should be able to clone it.
Run the git clone command.
git clone (the url to your remote repository)
If you go to your repository on the right hand side of the page you will find the url to clone.
I have been trying to set up a staging machine to run project at home (rails application).
# Remote machine connection
REPLOGIN=joel
REPADDRESS=192.168.2.100
REPLOCATION=/Users/joel/Projects/bio_watts #Repo location
REPNAME=biowatts
# Copy the repo to the server
echo "Copying the git repo to the server $REPADDRESS"
echo "repname:$REPNAME"
TEMPREP="$REPNAME.git"
echo "$TEMPREP"
git clone --bare .git $TEMPREP
scp -r $TEMPREP $REPLOGIN#$REPADDRESS:$REPLOCATION/
# Set up the origin for the project
#echo "Linking current repository to remote repository"
git remote add imac $REPLOGIN#$REPADDRESS:$REPLOCATION/$REPNAME.git/
All this worked fine
$git remote
imac <== this is my remote machine
When I try to git push to this machine I get:
Permission denied (publickey,keyboard-interactive).
fatal: The remote end hung up unexpectedly
I know there is something about SSH ... but I don't understand what I need to do on my local and on my remote machines (Mac OS X Lion).
Can someone help?
Cheers,
Joel
NEXT QUESTION:
On my remote machine I do find my cloned biowatts.git file ... but I don't see the project files (rails app) ... how does it work?
My intent is to git push to my imac and run my app there (thin start) ???
Do I need to copy my file manually? I assumed that the git clone would copy every I needed ...
Your remote git server should know your machine via your iMac's public ssh key and should have a config somewhere allowing you to push (write rights).
That remote machine needs to know about your ssh keys.
You need to generate a key locally (if you don't have one) and then add the public key to the remote server's ~/.ssh/authorized_keys
You can follow the GitHub tutorial on setting up keys (if you don't already have them set up).
http://help.github.com/mac-set-up-git/
Instead of Step 4. Add your SSH key to GitHub, you'll need to add your key to the authorized_keys file on the server.
In the future, for those of you encountering this in assembla specifically, the solution is to copy your ~/.ssh/id_rsa.pub to the assembla profile. This post gives step by step instructions.