Move git configuration from Windows to Ubuntu

I recently started using git on windows 7 and configured everything to access Github, Bitbucket and a private server over ssh.

Now I am switching to Ubuntu OS and I am not sure how to copy the keys and configuration settings over to Ubuntu.

  • cat .git/HEAD command in Windows?
  • Get history/log of a (potentially removed) file in Git
  • What is the RIGHT way to use git and public repos?
  • Is git difftool on binaries possible? If so, how does one configure it?
  • Where are the Git branches stored?
  • Cannot open FETCH_HEAD after renaming a branch
  • Will you please help me out or point me in the direction of how to do it right ?

  • Invoking external difftool from git-gui?
  • git diff reporting mode changes after moving the repository
  • Create symlink file hierarchy from git branches
  • Github search using regex
  • Cannot access git (atlassian stash) repository from reviewboard
  • How to checkout a forked pull request locally with TortoiseGit?
  • 4 Solutions collect form web for “Move git configuration from Windows to Ubuntu”

    To build upon Hi-Angel’s answer:

    Under Windows 7

    • The local Git config is inside the .git directory at the root of your repository/project.
    • The global Git settings are in C:\Users\<user_name>\.gitconfig.
    • The SSH keys you generated are in C:\Users\<user_name>\.ssh (at least, this is the standard).

    Under Ubuntu/Linux

    • The local Git config is inside the .git directory at the root of your repository/project (no change and no work here).
    • The global Git settings are in ~/.gitconfig.
    • The SSH keys you generated are in ~/.ssh (at least, this is the standard).

    Doing the switch

    Copy your .gitconfig and .ssh folders from one to the other and you should be good to go.

    If you configured some things specific to your OS (such as default editors), you will have to configure those again or reset them after performing the copy, but this cannot be avoided.

    Just a note about SSH and security

    You may consider it a hassle, but if one of your computers is a laptop, I would recommend configure separate SSH keys. That way, if your laptop ever gets stolen, you can remove the key and this laptop will never be able to mess with your central repository.

    It may not seem that important for codes, but if you use SSH for other purposes (like administering your private server), I think it is crucial to be able to select which computers are allowed to connect.

    Local setting are being stored in the root of you project directory with the name of the dir .git. But since the project you may probably download from an internet, so the .git directory appears automagically, I guess you wanted global settings.

    The directory of the global settings in Windows® is C:\Users\<user_name>\.gitconfig. In GNU/Linux it is ~/.gitconfig, so you may just copy a content there.

    I would recommend to simply copy the ssh public key of your new ubuntu machine into the github account. And the of course, clone the repo again on ubuntu to your favorite local folder

    You could use my blog on how to setup ssh keys on a Linux machine. After that you could copy the public key (by default located in /.ssh/id_*.pub file into your github account (Settings->SSH Keys)

    I think the simplest way is to copy the project folder with .git to your Ubuntu and generate new ssh keys for your new computer.

    Follow these links below to generate new ssh keys for your new computer and add to the git service. And then everything is done.

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