0

Me and my sister use same laptop I created one react app frontend only and wanted to upload on my GitHub whenever I do that it after committing changes and pushing it shows on my GitHub that my sister uploaded it, it shows her username not mine, watched several YouTube videos but all in vain.

Please help............

I tried uploading react app using git commands and it shows my sister's username that she committed changes in my profile but actually I did.

Azeem
  • 11,148
  • 4
  • 27
  • 40
  • Set the 'user.config' only for this repo (see existing answer). Then you will have to rewrite the history https://stackoverflow.com/a/1320317/717372 Maybe also you should not use the same user account in the laptop and have yours. It will be a lot easier... – Philippe Jun 07 '23 at 06:08
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 07 '23 at 11:45

1 Answers1

1

What you need to do is set repo-specific usernames and emails. If you are building a React app, and that repository is on your local machine, you can open up git bash on the folder and use:

git config user.name "Your Name Here"
git config user.email your@email.com

This will set the username and email for that repository only. Any other repositories on the machine will use whatever username and email is configured globally.

You can also use tools such as SourceTree, which show the commiter at the bottom before you commit, so that you are sure which user is being used for the commit.

M B
  • 2,700
  • 2
  • 15
  • 20