Set username and email for msysgit portable

I’m using msysgit for a school project so I can do commits and such while on the computers at school which do not have it installed.

Now the first thing one does when they install git is set up their .gitconfig how they like. However, since I cannot rely on the %HOME% directory of the computer to have the relevant file would using –system instead of –global for the git config command work?

  • How to proceed once git origin was forcefully pushed
  • Which commit hash to undo a pushed merge using git-revert?
  • Convert merge into rebase without having to perform the merge again
  • Gitolite access repair
  • How does git flow handle hotfix to older release or point release of older release
  • Get Travis Shield on Github to Reflect Selected Branch Status
  • The main settings of course would be and Would using –system work for those and all other similar settings? Would it save it to the gitconfig of the etc directory where git is installed on my USB drive?

  • Show history of a single file across all branches
  • How to make git show to use formatting?
  • How can I make/follow a release announcement feed on Bitbucket?
  • Using Git with a Samba shared folder
  • Is it possible to add/initiate a new git submodule with the ignore option set to a certain value?
  • How to sync forked repository without creating a new commit
  • 4 Solutions collect form web for “Set username and email for msysgit portable”

    You don’t have to expect the .gitconfig to exist. It will be created when you set the user name and email configurations. The README for the portable version recommends that you set the config with --global option too.

    Add yourself a script to the thumb drive that will set the config values you want (as per other responses). Then it’s a one line action to set up all your values.

    As far as I can tell from the discussion of this msysgit issue (especially comment 6 and what leads up to it) you should be able to do what you described. Use --system instead of --global with git config add ... and the like. That would modify the gitconfig file in the etc/ directory of the install. (or just modify it by hand, if you have other things you’d like to carry over from whatever standard one you usually use, if any)

    That’s the only way I can see that would still also cleanly honor any other relevant gitconfig files (like per-project ones). Then you can just use regular git commands like you would in a normal situation.

    Note that while usually --system refers to /etc/gitconfig, in the case of a portable install, it refers to the gitconfig file in the etc/ directory of the install.

    I believe this post describes how to achieve what you’re trying to do:

    Git Baby is a git and github fan, let's start git clone.