Set git user as already existing user in a project

Viewed 32

I'm working on a project in a company and I have a git user in my PC there. Now while I'm working remotely and I have cloned the project I want to set my user in my laptop as the same git user but I don't know how. Will having same email address and name in my laptop do the job?

Thank you

2 Answers

Yes it will. If you specify the same name and email in your .gitconfig, while working on the same project, there will be no difference between working from your company or working remote.

You can both have a general user, found in $HOME/.gitconfig, or per project user, found in your project, under .git/config.

In each computer, you should:

git config --global user.name "<username>"
git config --global user.email <mail>
git config --global core.autocrlf input

With the same data.

Related