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

Copy user.{name,email} from parent repo #7

Open
tvierling opened this issue Jun 10, 2014 · 2 comments
Open

Copy user.{name,email} from parent repo #7

tvierling opened this issue Jun 10, 2014 · 2 comments

Comments

@tvierling
Copy link

For those of us working on multiple projects with different targets (public/open-source, work/proprietary) on the same system, $HOME/.gitconfig may not contain a value for user.email, or even user.name -- or they may not be the same values as those within the project using sbt-ghpages.

It would be nice if the temporary repo copied these values from the project repo's view of git config. I just don't know where the GitRunner commands should go, as I'm not too familiar with sbt-git yet.

Essentially the git commands would be:

val userName = gr("config", "user.name")(projectRepo, s.log)
val userEmail = gr("config", "user.email")(projectRepo, s.log)
// ... then after creating the temporary clone ...
gr("config", "user.name", userName)(updatedRepo, s.log)
gr("config", "user.email", userEmail)(updatedRepo, s.log)

This would work no matter whether user.name and user.email are set locally in the repo or globally in $HOME/.gitconfig; it simply fetches what the project sees as the fully resolved values, and applies them to the gh-pages clone.

@tvierling
Copy link
Author

Note: I was able to work around this temporarily by going to ~/.sbt/ghpages/default/PROJECTNAME and doing the following:

git config user.name MYNAME
git config user.email MYADDRESS
git commit --amend --reset-author
git push --force origin

which will replace the initial commit with one having the correct values. As long as ~/.sbt/ghpages/default/PROJECTNAME remains as-is, it appears to retain those values on future push operations.

@ghost
Copy link

ghost commented Jan 31, 2015

Thanks @tvierling, finding this workaround was useful. I also have different Github profiles for various repos.

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

No branches or pull requests

2 participants