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

Figure out a strategy for [user]name, [user]email #60

Closed
croaky opened this issue Oct 21, 2012 · 4 comments
Closed

Figure out a strategy for [user]name, [user]email #60

croaky opened this issue Oct 21, 2012 · 4 comments

Comments

@croaky
Copy link
Contributor

croaky commented Oct 21, 2012

Every time I commit with the intention of submitting a pull request to thoughtbot/dotfiles, I have to be careful not to commit this part of my ~/.gitconfig:

[user]
  name=Dan Croak
  email=dan@thoughtbot.com

It'd be great to come up with a strategy that we could apply to anything that we want to share in thoughtbot/dotfiles but that have parts of files that are not shareable.

@jferris
Copy link
Member

jferris commented Oct 21, 2012

The install.sh script included in the dotfiles has the ability to help with this. If you include the line "DO NOT EDIT BELOW THIS LINE" anywhere in a config file, it will copy that file over instead of symlinking it, and it will leave everything above that line in your local config intact.

Here's the general layout of my .gitconfig:

# ADD LOCAL CONFIGURATION HERE
[user]
  name = Joe Ferris
  email = jferris@thoughtbot.com

# DO NOT EDIT BELOW THIS LINE
[push]
  default = current

You can edit everything in the local configuration section, and running install.sh again won't overwrite that; it will just overwrite the content below that.

@croaky
Copy link
Contributor Author

croaky commented Oct 21, 2012

The install.sh script included in the dotfiles has the ability to help with this. If you include the line "DO NOT EDIT BELOW THIS LINE" anywhere in a config file, it will copy that file over instead of symlinking it, and it will leave everything above that line in your local config intact.

Oh yeah, I seem to remember seeing that back in the day. That's awesome!

I took a stab at documenting it here:

#62

I'm now a little confused about whether the stuff above "DO NOT EDIT BELOW THIS LINE" should be in version control, like in croaky/dotfiles. I think not but would love your opinion.

@jferris
Copy link
Member

jferris commented Oct 22, 2012

You can put stuff in the top section, but anything above that line in ~/.gitconfig will never be updated by install.sh.

Here's what mine looks like in my dotfiles repo:

# ADD LOCAL CONFIGURATION HERE


# DO NOT EDIT BELOW THIS LINE
[push]
  default = current
# more stuff

@croaky
Copy link
Contributor Author

croaky commented Oct 25, 2012

This was addressed by documentation in 52b2ee1

@croaky croaky closed this as completed Oct 25, 2012
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