New Xcode project with Git show warning - xcode

I have set a new test project to see how to use git, so I have checked GIT when creating the project. Then I have pressed on the create button and got a weird warning (attached).
Then I have opened the project and all the files were marked with A (They shouldn't) as git
should commit them on the project creation.
Any idea how to configure a user for git?
I have also tried to open terminal and write the line from the error with my email. it didn't worked.
I use xcode 4.6.1

Executing the following two commands from the terminal should make sure you won't get this error in the future:
git config --global user.email "IOS.DEV#mail.com"
git config --global user.name "IOS DEV"

Related

Xcode Local Commit Fails with "Multiple working copies failed to commit files." Error

After updating to Xcode 10.1 when I select "Commit..." from Source Control I get the error
Multiple working copies failed to commit files.
It had always worked before.
Pushing to Bitbucket still works.
How can I get Commit to work again?
Reason & solution:
Xcode bug, author details are deleted when Xcode is updated, the following from cmd line in workspace dir fixes the problem:
xcrun git config user.name "your_user_name"
xcrun git config user.email your_email
After running the commands, restart Xcode

Xcode Source Control Git

When you create a new xcode project, there is a checkbox, which you can check if you want to use a git repository on your mac. I did not check that box, so right now I don't have access to source control resources. How can I start using git with my project?
I think you would just need to setup a local git repository.
Open terminal on your Mac and type the following commands:
cd <DirectoryYourCodeIsIn>
git init
git add .
git commit -m 'initial commit'
Also, restart XCode after this is completed.

Xcode asking me "who you are" (screenshot)

I started programing in xcode and when i launch it, xcode ask me "who you are". Does anybody know what is necessary to do? Thanks!
screenshot:
Xcode includes integrated support for Git. Your screen shot is Git asking for you to set your user name and email address (which is arbitrary, not some official Git login) which it uses to sign your commits. When you create a new Xcode project, you can de-select The "Source Control" option if you're not a Git user--see attached screen shot. When you start working on a "real" project, I suggest you learn the basics of Git for revision control of your project, such as adding files, making commits, and rolling back changes you might make that break things. Every time you add some piece of functionality and ensure it's working, make a Git commit. Then you can always roll back, or grab files, from previous known working checkpoints. This is all kept on your local machine, and then of course you have the choice to push to a remote repo such as Github.
To fix the problem, execute the two commands listed in the error message from the command line:
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe#example.com
Info on setting up Git

Bitbucket, Windows and "fatal: could not read Password for"

I recently reinstalled Windows and I have a problem with downloading files from repository.
I have installed GIT and Python, but when I am trying to download anything from Bitbucket I get the message:
"fatal: could not read Password for: 'https://username#bitbucket.org': No such file or directory".
What am I doing wrong?
I solved it setting a global parameter:
git config --global core.askpass /usr/libexec/git-core/git-gui--askpass
Try to include your username and password in the URL like this:
git clone https://username:password#bitbucket.org/path_to/myRepo.git
I had the same problem an hour or so ago. My issue was that I was trying to do a git clone but using the https url instead of the ssh one. If you go to your repository you can select ssh or https from the dropdown for the clone url. Hope that helps!
Just solved this Problem
Git in Version 1.8.5.2 contains a but using bitbucket, updating my Git to Version 1.9.0 solved this problem.
I just tried to do the same thing and it did not work for me, and I too recently reinstalled windows on my machine.
I am used to checking out a private repo from my bitbucket account by using the simple command
git clone https://username#bitbucket.org/username/repo.git
and then being prompted to enter a password for my user.
It looks like this might be broken in version 1.8.5.2. I downgraded to version 1.8.4 and it started working as expected.
Git download list: http://code.google.com/p/msysgit/downloads/list
Hope this helps!
For https connections try installing the "Git Credential Store" (an "optional" step in the BitBucket tutorial).
This is how to install it:
Download git-credential-winstore.exe from http://gitcredentialstore.codeplex.com/
Open the Git Bash Shell and change the current directory to where git-credential-winstore.exe is located
Run ./git-credential-winstore -i /bin/git
Try to use git fetch in order to reenter and update the outdated password.
I had the similar issue. The cached password become invalid due to updating the actual password to new one. But git didn't ask me for reentering the valid password and just gave me an error that Authentication failed while I was trying to pull changes.
But magically, git asked me for the actual password when I typed git fetch instead of pulling the data. Once I entered the new password, apparently git updated the old one in its credentials storage and no longer asked me about the entering password again.
FIX IT (09/2020)
All the the answers here are wrong... You shouldn't NEVER do something like that:
https://username:PASSWORD#Bitbucket.org
SOLUTION
All you have to do is:
Go to Sourcetree -> Preferences -> Git
You will have the section "Git Version" with 2 options: Reset to ebedded Git and Use System Git
Sourcetree use the Ebedded git for default.
Click on "Use System Git" and.... Fixed!
Follow me on:
GIthub
Twitter
In my case, the problem was with the global file .gitconfig on Windows.
When I tried to use solution provided by #jsarroyo in Git BASH, I got an error saying that the file .gitconfig.lock did not exist. I could find no way to fix it.
When I completely removed .gitconfig, everything worked fine.
WARNING: This way, you lose all your git settings and you need to configure it again.
In your project go to .git/config and add after username :password
before : https://username#bitbucket.org/repo.git
afetr : https://username:password#bitbucket.org/repo.git
I had the same problem with the Android Studio Chipmunk 2021.2.1 Patch 2 integrated version control. Additionally I have BitBucket and GitHub ssh keys setup on my Windows PC. I was able to fix the issue by setting checked Use credential helper in File | Settings | Version Control | Git
In my case, it was just a wrong password for bitbucket entered into the prompt dialog. When I entered the correct password, the error disappeared.
If you are using android studio you might want to try enabling "Use credential helper".
Steps:
Go to File -> Settings -> Version control -> Git
Find "Use credential helper" option (mostly at bottom)
Enable this option by marking the checkbox before the option
I got this issue when I upgraded from Windows 7 to 8 and settings messed up for me too. I had to regenerate private and public keys, and change my TortoiseGIT to use plink, instead of SSH.exe
I wrote step by step instructions at http://techblog.saurabhkumar.com/2015/09/using-tortoisegit-on-windows-with.html
For Bitbucket If you are ok for the repo to be public you can just uncheck the "This is a private repository" checkbox in repo settings. Now a simple git clone should work.

Git Repository Created Manually Can't Commit

After creating a Git Repository using the terminal application using the following commands
Focusing the shell on the project directory
$ cd ~/Desktop/Myproject
Setting up the Git Repository
$ git init
Preparing the files for the "staging area"
$ git add .
Making my first commit
$ git commit -m 'Initial Checkin'
When I now try to commit in Xcode, I get
The operation could not be performed because no valid working copies were found.
Please verify that your files are under source control and try again.
But if I modify any of the project files and $ git status in to shell, it will tell me that what ever file I fiddled around with in Xcode has been modified and the I can commit from there. Why not in Xcode??
I had a loot at Can't commit changes to local git repository but the suggestions did not solve the problem.
If restarting XCode doesn't help, since you are saying it works fine through terminal, try adding it again in XCode.
go to Organzier--> Repositories --> Add Repository (bottom left corner)-->Set the correct values and local path to your project
my guess is, since you created the repository outside XCode, for some reason, its not detecting it right, or is not having the right permissions. Re-adding the repository through XCode may help solve this issue for you.
I had this happen once, and the issue was cleared by quitting and re-opening Xcode.

Resources