π οΈ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
Open a terminal or command prompt.
Navigate to the directory where you want the project files to be placed.
Ensure the directory is empty, as Git does not allow cloning into a non-empty directory.
Execute the following command:
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
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
.
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:
Add the remote repository link to your local repository:
Verify the new remote URL:
Making Changes and Pushing to GitHub
Add Changes to the Repository
Make necessary changes to your files in the local directory.
Add the changes to Git:
Commit the changes:
Push Changes to GitHub
Push your changes using:
If you are prompted for authentication, enter your GitHub username and password.
Opening a Pull Request
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.
Clone Your Fork
Clone the forked repository to your computer:
Navigate into the cloned directory:
Create a New Branch
Create and switch to a new branch in your local repository:
Make Changes and Commit
Make changes in your local repository as required.
Add and commit those changes:
Push Your Branch
Push the branch to your GitHub fork:
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