Xcode Repositry Git Error - xcode

Please review the screen shot, and let me know how can i fix this? I am using my computer and this configuration from last 1 year and I have no issue, It is suddenly happen.

You seem to try to commit/push to a remote repository, while you haven't yet given git your identity/email address + password.
The steps to do this are already stated in the error message:
Just open up Terminal and enter the two commands:
git config --global user.email "youremail#example.com"
git config --global user.name "Your Name"
You'll be prompted for your password several times. To cache your password follow the instructions here: https://help.github.com/articles/caching-your-github-password-in-git/

Related

Can't add Git repository to Xcode 7 using https

After my upgrade to Xcode 7 the access to my Gitlab repo was denied. I am using HTTPS authentication. When I try to erase and than add a new the repo Xcode gives me an error : Authentication failed because the user name or password was incorrect.
The authentication field is set to Username and Password.
In that question a solution was given but for the SSH authentication:
Cannot push to gitlab from xcode 7
I prefer to use the HTTP method.
I think this is definitely an issue caused by the upgrade. Has someone else encountered that problem and can You share Your solution.
Recently I thought of that issue and tried to add a repository. Since the last time I checked the behaviour I have updated the Xcode to version 7.2. With a great relief I found that the problem has been fixed. However when I tried to commit / push to my repo I encountered an error "Couldn't communicate with a helper application" in Xcode 7". After some digging I found the answer here http://pinkstone.co.uk/how-to-fix-couldnt-communicate-with-a-helper-application-in-xcode-7/
I just followed the instructions and typed :
xcrun git config --global user.email you#yourdomain.com
xcrun git config --global user.name "Your Name Here"
in the terminal and the problem was fixed.

how to upload (commit) my first project to git hub from xcode

I started commiting my project to github.
For that I created an account in github with email and password.
Then on the console I did inital stuff:
cd project
git init .
git add .
git commit -s
-> I did not commit (stopped without comment), because I expected to enter a password.
In Xcode I committed one file for testing, but I was supriced why I was not asked for a password.
In the logs I see that it was published with a user, that I don't know : user#users-Mac.local
So I don't know where the file is published now for public !
Then I changed my name and email as follow:
xcrun git config --global user.name 'xxxxx'
xcrun git config --global user.email 'yyyyy'
But still I don't have to provide a password and I guess it is not working properly with my account.
Can anyone help me out ?
Getting code onto GitHub has two main steps:
git commit your changes
git push to GitHub
Nothing's asking you for a password when you commit, because that's still totally local to your machine. Only when you push will you need to authenticate with GitHub.
Check out these guides to help you get started:
Git basics
Set up Git with GitHub

Is it time to get a new Github account?

I got my Github account last year in February and configured it on my Windows XP. Successfully configured user.name and global email account. I switched operating system to Windows 8 and accessed the same Github account online.
I took the Try Git course and other supporting materials to start working with the repositories, but Git Bash keeps coming up with the invalid username and password login error on Bash. Completed the forking and would like to start working on a cloned .git template now, but I can't pass the error message.
I tried changing my username, which solved the error partially. On my local repositories list the newly forked folders are not found, and I'm not seeing any guides on how to use Git Shell on the website.
Any ideas on whether this is just a system setup error or is it time to get a new Github account?
You should check your git config using git config --list. If it differs from what your are using then change it with git config user.name YOUR_USERNAME and git config user.email YOUR_EMAIL. More info here.
What you configure as user.name and user.email is what goes into the author and committer fields of commits you create. It has nothing to do with authentication.

How do I update the password for Git?

I'm using BitBucket with Xcode and Git for version control, and recently I changed all of my passwords (thanks Adobe!).
Unsurprisingly, I'm no longer able to push my local commits to my repository on BitBucket (Authentication failed for 'https://______.git'), but I'm forgetting how to update the cached password on my iMac. Somehow I've been unable to find it on Google or Stack Overflow, though it seems to me it should be rather straightforward...
To fix this on macOS, you can use
git config --global credential.helper osxkeychain
A username and password prompt will appear with your next Git action (pull, clone, push, etc.).
For Windows, it's the same command with a different argument:
git config --global credential.helper wincred
None of the other answers worked for me on MacOS Sierra 10.12.4
Here is what I had to do:
git config --global --unset user.password
Then run your git command (ex. git push) and reenter your username and password.
In Windows 10 with Git
Remove/update related Credentials stored in Windows Credentials in >>Control Panel\All Control Panel Items\Credential Manager
Or you can just use the search bar and search for "CredentialManager" or "Windows Credentials", which should return an entry to open that Control Panel pane (at least for English users).
The only way I could modify my git password was to go to Credential Manager in Windows (Windows Key + type 'credential') and edit the git entry under Windows Credentials 🡒 Generic Credentials.
Note: Not listed alphabetically
I had the same problem, and the accepted answer didn't help me because the password wasn't stored in the keychain. I typed:
git pull https://myuser#bitbucket.org/mypath/myrepo.git
Then console asked me for my new password.
In windows 10 as mentioned above by #Imran Javed you can find Generic Credentials at :
Control Panel\All Control Panel Items\Credential Manager --> Windows Credentials
find your git server and than you can update password by clicking edit button.
For Mac
If you have multiple remote repositories (Github, Bitbucket, Job, etc.)
1) run in the project directory
git config --unset user.password
2) run remote git command (ie. git push or git pull)
Git will prompt you to reenter your user.name and user.password for this repository
Or you can do it globally if you have only one remote repository
git config --global --unset user.password
If you are MAC user then you can open KeyChain Access Application from finder and then look for your account listed there. Just click on it and update your password.
Now give a try and things will fall in place.
link for reference: Updating your credentials via Keychain Access
None of the other answers worked for me on MacOS Big Sur 11.3.1
I had Two-Factor Authentication enabled on Github, this makes is so you will fail when entering your username and password even when they are correct.
Here is what I had to do:
git config --global --unset user.password
Then run your git command (ex. git push) and enter your username.
For the password you need to generate a Personal Access Token.
Go to https://github.com/settings/profile select the Developer Settings on the right. Select Personal Access Token Generate new token. Copy the generated token and use it as the password in terminal.
running git config --global --unset user.password followed by any git command would prompt you to enter username and password.
git config --global --unset user.password
git push (will prompt you for the password)
git status (will not prompt for password again)
In my Windows machine, I tried the solution of #nzrytmn i.e.,
Control Panel>Search Credentials>Select "ManageCredentials">modified new credentials under git option category corresponding to my username.
And then,
Deleted current password:
git config --global --unset user.password
Added new password:
git config --global --add user.password "new_password"
And It worked for me.
If your credentials are stored in the credential helper, the portable way to remove a password persisted for a specific host is to call git credential reject:
$ git credential reject
protocol=https
host=bitbucket.org
⏎
or
$ git credential reject
url=https://bitbucket.org
⏎
After that, to enter your new password, type git fetch.
Given the new token authentification requirement from August 13 2021, this may be what you are looking for:
Generate a new access token
Update the token used to access your repo
git remote remove origin
git remote add origin https://[TOKEN]#github.com/[USER]/[REPO]
git push
There is such a confusion on this question, as there is way too much complexity in this question. First MacOS vs. Win10. Then the different auth mechanisms.
I will start a consolidated answer here and probably need some help, if I do not get help, I will keep working on the answer until it is complete, but that will take time.
Windows 10: |
|-- Run this command. You will be prompted on next push/pull to enter username and password:
| git config --global credential.helper wincred (Thanks to #Andrew Pye)
`
MacOS:
|
|-- 1. Using git config to store username and password:
| git config --global --add user.password
|
|---- 1.1 first time entry
| git config --global --add user.password <new_pass>
|
|---- 1.2 password update
| git config --global --unset user.password
| git config --global --add user.password <new_pass>
|
|-- 2. Using keychain:
| git config --global credential.helper osxkeychain
|
|---- 2.1 first time entry
| Terminal will ask you for the username and password. Just enter it, it will be
| stored in keychain from then on.
|
|---- 2.2 password update
| Open keychain, delete the entry for the repository you are trying to use.
| (git remote -v will show you)
| On next use of git push or something that needs permissions, git will ask for
| the credentials, as it can not find them in the keychain anymore.
`
I was pushing into the repository for the first time. So there was no HEAD defined.
The easiest way would be to:
git push -u origin master
It will then prompt for the password, and once you enter that it will be saved automatically, and you will be able to push.
If you are using github and have enabled 2 factor authentication, you need to enter a Personal access token instead of your password
First reset your password:
git config --global --unset user.password
Then, log to your github account, on the right hand corner, click on Settings, then Developer Settings. Generate a Personal access token. Copy it.
git push
The terminal will prompt you for your username: enter your email address.
At the password prompt, enter the personal access token instead.
do these steps in Terminal:
Delete current password saved in your Mac
git config --global --unset user.password
Add your new password by using this command, replace with your new password:
git config --global --add user.password <new_pass>
you can change password through command line in 2 places, following would edit credentials to connect the repo
git config --edit
The credentials also can be changed at global using global parameter like below
git config --global --add user.password "XXXX"
or set the credentials helper with
git config --global credential.helper wincred
but if you have repo level credentials set the use the first command
git config --edit
For MacOS based on the new rule to use password tokens from August 13 2021.
I tried all other terminal based answers but none worked.
Simply head to Keychain Access
Search for github
Right click on all github related items, including vs-code,
Delete all items
my password was good in github desktop preferences but wrong in the .git/config file
for me the only working solution was to manually edit the file:
.git/config
that contains this line:
url = https://user:password#github.com/user/repo.git
change password to the GOOD password because it was an older one for me
I was able to change my git password by going to Credential Manager in Windows and deleting all the git entries under Windows Credentials 🡒 Generic Credentials.
When doing a git pull or git push, windows will ask for the new user/password itself.
I would try to delete my account in Keychain Access and then run git clone again. Git will ask me for a new password.
on mac BigSur 11.2.3
I updated the credentials in the key chain then I ran the command below.
git credential-osxkeychain erase
host=github.com
protocol=https
I had to do this because no other solution in this thread worked for me after changing to token auth for github. github kept stating repository not found.
If this does not work try to combine this with the other commands for mac in this thread.
Just clone one of your existing repos, this will prompt you for new credentials:
e.g.
git clone https://myuser#bitbucket.org/mypath/myrepo.git
(where https://myuser#bitbucket.org/mypath/myrepo.git is an address of one of your existing repos)
Tried everything but nothing worked. Then the following did work.
Before any of the above steps, lock and unlock the keychain again coz sometimes it sorta gets stuck.
Install the GitHub Desktop — it helps.
For those who are looking for how to reset access to the repository. By the example of GitHub. You can change your GitHub profile password and revoke all "Personal access tokens" in "Settings -> Developer settings" of your profile. Also you can optionally wipe all your SSH/PGP keys and OAuth/GitHub apps to be sure that access to the repository is completely blocked. Thus, all the credential managers, on any system will fail at authorisation and prompt you to enter the new credentials.
Following steps can resolve the issue .....
Go to the folder ~/Library/Application Support/SourceTree
Delete the file {Username}#STAuth-bitbucket.org
Restart Sourcetree
Try to fetch, password filed appear, give your new password
Also can run git fetch command in terminal and need to type password
Done
None of the command line options from within terminal worked for me. Ultimately, I just opened up keychain manually, searched for 'git' under 'All Items', found an entry there and deleted it. That did it! Next time I tried a git pull from the terminal and it prompted me for new creds.
For MAC users, using git GUI (Works for Sourcetree, may work for others as well). Would like to add a small remark to Derek's answer. The original suggestion:
$ git config --global --unset user.password
should be followed by a push/pull/fetch BUT it might not work when done from the GUI. The %100 working case would be to do the very first consecutive prompt-triggering git command from console. Here is an example:
Locate to your git repository root directory
Type in $ git config --unset user.password
Proceed with a git commend of your choice in terminal e.g.: $ git push
Then it will ask you to provide the new passoword.
On macOS, e.g. after OSX v.11.6, should go to KeyChain and search "git". And delete the relevant keys. It will work.

What are the necessary settings for "git configuration"?

when I create a project in Xcode 4.3 it keeps on displaying message saying below.I did not get what that means and how to do the necessary settings.
Any help will be greatly appreciated.
Thanks
Baha
Please tell me who you are
Run
git config --global user.email
"you#example.com"
git.config --global user.name"Your
Name"
to set your account's default identity.
Omit --global to say the identity only in
this repository.
fatal:unable to auto-detect email address
(got 'Home#s-imac-3.(none)")`
It's telling you literally, exactly what to do. Open a Terminal session, and run this, replacing 'you#example.com' with your email address:
git config --global user.email "you#example.com"
This sets your email address for git, it uses this to identify who you are in commits.
Then, run this, replacing 'Your Name' with your name:
git config --global user.name "Your Name"
This sets your name for git commit messages, it uses this to give a more readable name to commits.
If this stuff is not clear to you, you really owe it to yourself to learn git: http://try.github.io
Set Name & Email in Xcode preference, this issue will be resolve
Follow these 4 simple steps
Xcode => Preferences => Source control => Git
Set ( Author Name ) & ( Author Email ), just for identify that the code committed by this name/email
close Xcode and re-open project
now try to commit code, it should be working fine now.
Could be a issue with Xcode. Go to your git directory and set the user locally. See the following help thread at Apple Forum for more info:
https://forums.developer.apple.com/thread/18189
I had same issue in xCode 8.3.2, when I tried to create git repository on local machine. And I fixed it by setting local repository name and email. If anyone is having same issue; just run these commands in terminal:
cd my/project/directory (Navigate to project directory)
git config --local user.email "me#me.com"
git config --local user.name "myname"
NOTE: This is for local repository, and "--global" flah can be used for remote repositories.

Resources