Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove --global flag when setting user #66

Merged
merged 2 commits into from
Oct 12, 2022

Conversation

awxalbert
Copy link
Contributor

use command like this git config --global user.name would create a .gitconfig file every time when creating a MR, which is unnecessary and may cause error. Local git config is enough, tested in my own gitlab repo.

截屏2022-10-12 10 54 28

@changeset-bot
Copy link

changeset-bot bot commented Oct 12, 2022

🦋 Changeset detected

Latest commit: dbfcfac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
changesets-gitlab Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 12, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@JounQin
Copy link
Member

JounQin commented Oct 12, 2022

use command like this git config --global user.name would create a .gitconfig file every time when creating a MR

This is strange, what is the content? A .gitconfig is only for the local project, and --global should not affect that.

Do you have any global .gitconfig may affect this? Or maybe it's some kind of issue from git itself.

And also, if a .gitconfig is already added, remove --global will also affect that file, which is very unexpected.

@awxalbert
Copy link
Contributor Author

I think this may be the intended behaviour for git in CI. From the doc here, I guess

  1. When you run git config --global, it will try to create a .gitconfig file in your repo
  2. When you run git config --local(optional) it will try to create a .git/config file in your repo

A .gitconfig is only for the local project

This is not true, this file belongs to per user, it's not in project scope, .git/config does.

Do you have any global .gitconfig may affect this?

Nope, I don't have a local .gitconfig file, that's why I think it's unnecessary.

And also, if a .gitconfig is already added, remove --global will also affect that file, which is very unexpected.

Not sure if it will be affected, from the doc, we can see, local .git/config file takes precedence over .gitconfig, so maybe it will have no effect, this need to be tested.

So have you met this problem already ?

@awxalbert
Copy link
Contributor Author

Just forget about the content, it's nothing else but only the user information setupUser sets.

截屏2022-10-12 11 24 54

@JounQin
Copy link
Member

JounQin commented Oct 12, 2022

So have you met this problem already?

I have never met the issue you mentioned, but sure I just find changesets/action#128, so I believe you're right here! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants