Changing the name of the committer in Xcode - xcode

i am working with an other developer in developing an iOS application and now he don't work with us and i am working with his computer but the problem is when i push my code i am seeing his name appearing in the github. how i can change this and put my name appearing in the github. thanks for your answers.

Do you have a .gitconfig file in your project directory, if so, cd into the project directory and run the following commands to set it to your name and email in the .gitconfig file of your project
git config user.name "Your Name"
git config user.email "your-email-address#email.com"
If you do not have a .gitconfig file in your project directory, it could be using the global .gitconfig file located in the Home directory (~/). Simply add the --global flag to set it on a global basis for all projects (note, if there is a .gitconfig file within the project directory, it will use that rather than the global .gitconfig in the home directory)
git config --global user.name "Your name"
git config --global user.email "your-email-address#email.com"

Related

How to login github in cmd?

I need to change directory from this directory to my git hub account, like : (my name) (my repository), I set global email and global username but it didn't work, please help me
You should make a new folder and locate it, on the local machine. Then you should make a pull from the remote repository you are mentioning with the help of the following command,
git pull <remote url>
and you can set it.
To check out your username and email you can use the following command
git config user.name
git config user.email
In order to change or set the global username and global email you can use
git config --global user.name "Name"
git config --global user.email "mail#xyz.com"

Git 2.13 conditional config on windows

Git version: 2.13.0.windows.1
OS: Windows 7
CLI: Git bash
.gitconfig
[user]
name = Gyandeep Singh
email = private#email.com
[push]
default = current
[core]
autocrlf = input
[includeIf "gitdir: ~/Documents/webstorm/corporate/"]
path = .gitconfig-work
.gitconfig-work
[user]
name = Gyandeep Singh
email = corporate#email.com
Both the config files above sit together in the same directory (home).
What happened: open CLI on a folder (example test) inside corporate folder and then run git config user.email the output is private#email.com.
Expected: Outcome should be corporate#email.com.
Am I doing something wrong or my expectation is not correct? I did follow the git docs.
Solution
You have to run git config --show-origin --get user.email on a git initialized directory. If its not git initialized then the includeIf gitdir functionality will not work.
Its strange but true. I wish it still worked.
Your global C:/Users/<user-name>/.gitconfig should have this includeIf:
[includeIf "gitdir:C:/Users/<user-name>/Documents/webstorm/corporate/"]
path = .gitconfig-work
with having your work Git repos in C:/Users/<user-name>/Documents/webstorm/corporate and the conditional work configuration should be located at C:/Users/<user-name>/.gitconfig-work.
That's at least working for me in Window's cmd and Cmder. A git config --show-origin --get user.email should than show you from where a config value is loaded/resolved.
It also seems like the conditional work configuration is only used when issued from within a Git repository.
C:\Users\<user-name>\Documents\webstorm\corporate
λ git config --show-origin --get user.email
file:C:/Users/<user-name>/.gitconfig foo#oss.com
C:\Users\<user-name>\Documents\webstorm\corporate\some-repo
λ git config --show-origin --get user.email
file:C:/Users/<user-name>/.gitconfig-work foo#company.com
C:\Users\<user-name>\Documents\webstorm\corporate\some-non-repo-dir
λ git config --show-origin --get user.email
file:C:/Users/<user-name>/.gitconfig foo#oss.com
You need to turn off case sensitivity: change "gitdir:" to "gitdir/i:"
[includeIf "gitdir/i:C:/Work/"]
path = .gitconfig-work
[includeIf "gitdir/i:C:/My/Dev/"]
path = .gitconfig-my
from:
https://github.com/Microsoft/vscode/issues/62921#issuecomment-437693020
The accepted answer, while helpful, does not answer the question.
As of this writing, includeIf only works inside a git initialized folder.
So if you cd into "~/Documents/webstorm/corporate/somegitproject" and run the command the output will be as expected:
$ cd ~/Documents/webstorm/corporate/somegitproject
$ git config user.email
corporate#email.com
This is probably a defect against git, since a user would expect this to work similarly in "~/Documents/webstorm/corporate/" as well.
There is a typo here:
[includeIf "gitdir: ~/Documents/webstorm/corporate/"]
path = .gitconfig-work
There should be no space after gitdir::
[includeIf "gitdir:~/Documents/webstorm/corporate/"]
path = .gitconfig-work
Removing it will correct the behavior within an initialized Git repository.
This will show the entire Git configuration and what Git config files it is drawn from:
git config --list --show-origin
CAVEAT: If you run this inside a Git repository it will show values from .gitconfig-work, but it will not if you are within ~/Documents/webstorm/corporate/, but outside a Git repository.
The OP concludes that includeIf functionality does not work in normal non-git directories.
This is provably incorrect for at least the configuration item core.sshCommand. If a conditionally included .gitconfig has a core.sshCommand configured, it is used in git clone operations in normal non-git directories.
It seems that the part that doesn't work properly is the display of conditionally included configuration. Which is quite problematic and interferes with tracking down broken configurations.
I mapped a directory to a drive on a windows machine with subst D: <mapped directory>. If you want to know the path of your repository you can use this command in the repository context:
git rev-parse --show-toplevel
The output was something like this:
<mapped directory>/<name of repository>
So I changed it to:
[includeIf "gitdir:<mapped directory>/"]
path = .gitconfig-work
Now it works for me.

Installing git on Windows 10, unable to access .gitconfig

I'm new to git, and i'm trying to install git 2.9.2 from here. In the installation (the last of the many) i chose to run it from bash only. I now try to set it up, and the first thing i try is to set my name with
$ git config --global user.name "My Name"
But after i execute this, i get:
fatal: unable to access 'C:\Program Files\Git\ C:\Windows\system32\config\systemprofile/.config/git/config': Invalid argument
Let's say that i now want to clone a repository. I insert something like:
git clone https://username#bitbucket.org/team/repo.git
But i get:
fatal: unable to access 'D:\TestRepo\ C:\Users\username/.config/git/config': Invalid argument
I thought that the .gitconfig file should be inside the C:/Users/username directory, but it tries to locate C:\Users\username/.config/git/config, which seems a little weird. My HOME variable is %USERPROFILE%, as it should. Any help appreciated.
Ok i guess my lack of knowledge over basic things made me look stupid...
I just had to delete the HOME environmental variable and all worked like charm. I don't even remember why i had a HOME variable set (isn't that a linux thing?)
Anyway thank you for your time guys.
Did you use git init on the folder you are trying to operate from?
Also you need to configure your username and the email to your github account for it to work properly.
git config --global user.name "username"
git config --global user.email "email#gmail.com"
Finally, if you have a space in your name please remember to escape it. ex: "my name" = "my\ name"
did you set up your remote repository?
git remote add origin https://github.com/rodoggx/yourRepository.git
Same issue. But if I run with command shell (not bash) with Admin level, git config --global -l works. My git version 2.25.0.windows.1
I noticed that in the System Info gui of Windows, the env variables for System had a HOME entry of %USERPROFILE%. But, the User env variables did not. I added HOME to that too.
Now it works. You'd think the System env would fill in for those not in User. Maybe something else is going on.

Can't configure git, missing .gitconfig file

when I try to config Git I receive the following error:
$ git config --global user.name "John Smith"
error: could not lock config file /Users/John/.gitconfig: No such file or directory
My root directory is completely missing a .gitconfig file. When I try to make a new one I receive this error:
$ touch ~/.gitconfig
touch: /Users/John/.gitconfig: No such file or directory
My git's location:
$ which git
/usr/local/git/bin/git
I've tried reinstalling Git several times (running OSX Yosemite) and I'm still having the same issue. I also cannot locate any .gitconfig.lock files, as mentioned in some posts regarding this issue.
So I ended up solving this issue by reading the Customizing Git section of the documentation.
While I could not touch a new .gitconfig file in my root directory as stated above, I read that the first place Git looks for configuration values is in etc/gitconfig (note the lack of a . in the name).
So I created a file called gitconfig inside of the etc directory and filled it in with a sample gitconfig I found online, and added my user information to the top like so:
[user]
name = John Smith
email = jsmith#example.com
I was then able to commit as my usual self, however I still don't have a .gitconfig in my root, so I am unable to config Git using git config --global, and must do the configurations manually in etc/gitconfig.
For me the .gitconfig file was missing.I tried reinstalling Git several times, however it din't help me. I resolved the issue by performing the below steps.
create a folder structure c:/dev/home if already not present.
Open the Windows command prompt. (Run as administrator)
From the Windows command prompt, run the command "git init"
Run the following command:
git config --global user.name "Example"
Run the following command:
git config --global user.email "Example#gmail.com"
The above steps will create the .gitconfig file in the path c:/dev/home and you will be able to set your desired username and email id.
On Windows systems, Git looks for the .gitconfig file in the $HOME directory (C:\Users\$USER for most people). So copy the file created in the above step to your Home directory by providing the required permission.
I solved that. By adding .gitconfig file to the Home directory. Now it works fine.

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