Skip to content

Git config is weirdly synchronized between host and guest #199

Description

@LeBenLeBen

If you use Git to commit inside the Vagrant box, you end-up with a commit signed by "Vagrant User" instead of your name/email configured in your host git config.

Reproduction Steps:

  1. Create a blank box with the role Git
  2. Commit something inside the box: git commit -m "Test" --allow-empty
  3. The commit is signed by "Vagrant User" with a generated email depending on the project name

Expected behavior:

The commit should be signed with the same config as my host Git config.

Observed behavior:

The role git seems to correctly set the config in the guest at /etc/gitconfig. However, another git config is created at ~/.gitconfig. I tried to delete this file but everytime I run a git command, this file gets recreated with an empty "name" and "email" field. I was able to make it work by removing the empty "name" and "email" fields from the ~/.gitconfig file. It then fallback to the /etc/gitconfig values which are the expected ones.

Drifter version: 1.4.0
Vagrant version: 1.9.5
OS and version: MacOS 10.12.6

Additional information:

  • Problem started happening recently, didn't happen in an older version of Drifter: I think so, it might comes from a new version of Git or differences in the base boxes
  • Problem can be reliably reproduced, doesn't happen randomly: Yes
  • Problem happens to my colleagues aswell or only me: Yes

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions