πŸ› οΈGit Guide

Cloning a Git Repository Directly into the Current Directory

This guide will demonstrate how to clone the nexus repository from GitHub directly into the current directory without creating a new project folder.

Prerequisites

  • Ensure Git is installed on your system. If Git is not installed, follow the installation guide for your operating system provided below.

Steps to Clone the Repository

  1. Open a terminal or command prompt.

  2. Navigate to the directory where you want the project files to be placed.

  3. Ensure the directory is empty, as Git does not allow cloning into a non-empty directory.

  4. Execute the following command:

git clone https://github.com/toowake/nexus.git ./

Connecting to a GitHub Repository and Contributing

This guide will cover how to connect your local folder to your own GitHub repository, make changes, and contribute back to the main repository through a pull request.

Setting Up Your GitHub Repository

  1. Create a New Repository on GitHub

    • Go to GitHub and sign in to your account.

    • Navigate to your Repositories page and click the New button.

    • Name your repository and set it to public or private as required.

    • Click Create repository.

  2. Connect Your Local Project to Your GitHub Repository

    • Open your terminal and navigate to your project directory.

    • Initialize the directory as a Git repository if not already done:

      git init
    • Add the remote repository link to your local repository:

      git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
    • Verify the new remote URL:

      git remote -v

Making Changes and Pushing to GitHub

  1. Add Changes to the Repository

    • Make necessary changes to your files in the local directory.

    • Add the changes to Git:

      git add .
    • Commit the changes:

      git commit -m "Your commit message"
  2. Push Changes to GitHub

    • Push your changes using:

      git push origin main
    • If you are prompted for authentication, enter your GitHub username and password.

Opening a Pull Request

  1. Fork the Main Repository

    • Navigate to the original repository provided (https://github.com/toowake/nexus).

    • Click the Fork button at the top right of the page to create a copy of the repository in your GitHub account.

  2. Clone Your Fork

    • Clone the forked repository to your computer:

      git clone https://github.com/YOUR_USERNAME/nexus.git
    • Navigate into the cloned directory:

      cd nexus
  3. Create a New Branch

    • Create and switch to a new branch in your local repository:

      git checkout -b feature-branch-name
  4. Make Changes and Commit

    • Make changes in your local repository as required.

    • Add and commit those changes:

      git add .
      git commit -m "Detailed description of changes"
  5. Push Your Branch

    • Push the branch to your GitHub fork:

      git push origin feature-branch-name
  6. Open a Pull Request

    • Go to your repository on GitHub.

    • You’ll see a Compare & pull request button. Click it.

    • You can also go to the "Pull Requests" tab and click the New pull request button.

    • Select your fork on the right dropdown list, and the branch you pushed to.

    • Click Create pull request.

    • Add any descriptions of the changes, and when you’re ready, click Create pull request again.

This guide provides all the necessary steps to connect your local directory to a new GitHub repository, push changes, and also make contributions back to an original repository through a pull request.

Last updated