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

How to use several git configs on one machine and be able to separately sync settings to corresponding github account settings repo? #54

Open
d3lv1n opened this issue Nov 28, 2023 · 4 comments
Assignees

Comments

@d3lv1n
Copy link

d3lv1n commented Nov 28, 2023

Hi.

For example:

I have $HOME/.gitconfig:

[includeIf "gitdir:~/personal/"]
  path = ~/.gitconfig-personal
[includeIf "gitdir:~/work/"]
  path = ~/.gitconfig-work

$HOME/.gitconfig-personal:

[user]
  name = personal_user
  email = personal_email

And $HOME/.gitconfig-work:

[user]
  name = work_user
  email = work_email

I also have personal and work Sync Settings profiles:

settings.yml for personal profile:

hostname: ""
profile: personal
repository:
  type: git
  url: https://github.com/<personal-username>/editor-settings.git
  branch: main

And settings.yml for work profile:

hostname: ""
profile: work
repository:
  type: git
  url: https://github.com/<work-username>/editor-settings.git
  branch: main

And when I'm switched to the work Sync Settings profile and using Sync Settings: Upload (user -> repository) command in VSCodium, I want to push those work settings to my work github account only and of course, I want my work git name and email to be used from the corresponding git config.

Of course, this setup does not work, it is more for what I want to achieve. Is there a way to achieve this somehow not necessarily having the exact setup?

@daiyam
Copy link
Member

daiyam commented Nov 28, 2023

The remote git create a local git in VSCodium's global storage. So the includeIf of .gitconfig won't match.

You could use a local git under your directories (ex: ~/personal/editor-settings). But you would need to manually push or add hooks to do the pull/push (not tested, what about the commit message??)

But the best would be to add options either directly in the settings.yml or to include a simple .gitconfig-personal file.

I will have to free some time since a bunch of feature requests are piling up...

@d3lv1n
Copy link
Author

d3lv1n commented Nov 28, 2023

I see, thanks for the quick response, this is not urgent for me as I'm currently using VSCodium only for personal projects and VSCode for work related ones (due to some extensions I have to use at work), but in the future I would like to completely get rid of VSCode :).

Would be great to have some simpler solution to such problem, but thanks for the advice with the local repos.

@d3lv1n
Copy link
Author

d3lv1n commented Nov 28, 2023

Should I close this issue or can it serve as a probable feature request in the future?

@daiyam
Copy link
Member

daiyam commented Nov 28, 2023

You can leave it opened.

@daiyam daiyam self-assigned this Nov 14, 2024
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

No branches or pull requests

2 participants