Search code examples
gitgithubemacs

How do I set up git clone one of my repositories


I have an Emacs Configuration in a repository and whenever I do git clone <repository> it creates for me a folder with the name of the repository and the configuration files inside

I would like it to only create "clone" the settings files instead of creating a folder with the files inside


Solution

  • I think there are 3 options:

    1. Download the files without cloning the repository
    2. Clone contents of a GitHub repository (without the folder itself):
      • git clone url . - works only if the current directory is empty
      • git init trick - (see the link)
    3. Configure Emacs to load the config file from a different location:

      replace your ~/.emacs.d/init.el with this:

      (setq user-emacs-directory "/path/to/git_repo/")
      (load "/path/to/git_repo/init.el")