Try   HackMD

GitHub Desktop: Creating a "fresh" Git repo vs. turning an existing directory into a Git repo

Creating a "fresh" Git repo

  1. In the top toolbar, click File > "New Repository…"

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  2. In the dialog window that pops up, you will be able to provide a lot of information on how to create a new repository in a new directory. If you choose to create a repo with name "git_demo", and choose your Desktop under Local Path, it will create new folder called "git_demo" on the Desktop that is now configured to track changes.

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  3. Click the "Create Repository" button to make this all happen.

Turning an existing directory into a Git repo

  1. Let's assume you have an existing folder of data, scripts, documentation, etc. on your Desktop called "git_demo".

  2. In the top toolbar, click File > "Add Local Repository…"

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  3. In the dialog box that pops up, click "Choose…" to choose this existing directory described in Step 1. If this directory is not under version control, you will see a warning message "This directory does not appear to be a Git repository. Would you like to create a repository here instead?"

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  4. Click the "create a repository" link. It will open a very similar dialog as we saw in the first section. You will be able to change the repository "Name", "Description", and all other options except you will not be able to change the Local Path.

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  5. If you click the "Create Repository" button, it will add in some hidden directories under the "git_demo" directory that will enable it to start tracking changes going forward.

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →