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.

  • git pull remote master in detached head
  • How to remove a commit that has been pushed to the remote repository using Git
  • How can I view the git history in Visual Studio Code?
  • How can I rename a git stash?
  • GIT pull/fetch from specific tag
  • How to wean myself from FTP in favor of Version Control
  • Will you please help me out or point me in the direction of how to do it right ?

  • Reverting part of a commit with git
  • Git: How to squash all commits on branch
  • local git hook for “git remote update”?
  • Find out all GIT changes in a certain line in a file
  • Using SubModules on AppHarbor
  • Sync the local code to Amazon server through GitHub webhook
  • 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.