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.

  • Setting jenkins git returns “Host key verification failed” error
  • In GIT, how can I prevent people from changing or removing commits that have already been pushed?
  • can I retrieve version of file from git for a given date?
  • Using git filters to ignore a specific line in json file
  • executing a git pull from a different directory
  • Gemfile syntax error: <<<<<<< HEAD when trying to start localhost
  • Will you please help me out or point me in the direction of how to do it right ?

  • Push git submodule changes to my own repo
  • How I can pull the new code from bitbucket?
  • Why is git checkout named that?
  • Git push new local branch to remote, without having to specify name
  • What are currently the problems with Git on Windows
  • How to colorify git errors, warnings and fatal messages?
  • 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 http://balajikatika-technical.blogspot.com/2014/10/setting-up-ssh-keys.html 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.