Cloning and Editing Repositories using Git - barrycumbie/solid-fishstick-snowcats GitHub Wiki

Melissa and Aditya

Overview

Git is a source code management tool. It is used with projects of various sizes and is free and open-sourced. With Git developers can track changes in the source code, work together with multiple others in non-linear development.

1️⃣ Step 1. Downloading Git

  1. Download git by going to gitforwindows.org
  2. On the website hit download. Screenshot 2024-02-08 153131

2️⃣ Step 2. Cloning a Repository

⚠️ This is assuming you have already created a Github repo. If you do not have a Github repo pls create one before continuing. ⚠️

  1. Go to your github repository
  2. Click on the green CODE button
  3. Copy the HTTP address
  4. Put it into this line of code in your terminal.
    git clone <link>

303496750-432abbce-7a96-4df9-9769-51d500a45fea

Cloning your repository allows you to make a copy of an existing repository, including all of its branches and files. This way you can make changes to a repository or branch without making anything permanent.

3️⃣ Step 3. Basic Operations

  • If you want to work on a branch of your cloned repository other than main type
    git checkout -b <desired branch>
  • If you want to create a new branch on the repo
    git branch [branch-name]
  • If you want the status of the file you are working on
    git status

4️⃣ Step 4. Saving the cloned repo to the original.

  1. Add the files with the code git add .
    303496764-caa7b72f-49db-4099-bcc1-a861fc346af6
  2. Use the code git commit -m "[descriptive message]"
    303496784-8535bc69-8006-4cdd-b237-a5374fd568ec
  3. Finally transmit the commits to the remote repository with the code git push --set-upstream origin [branch name]
    303496799-09480100-eecf-4341-889e-7144b0d67d68

GO TO YOUR GITHUB REPOSITORY AND CHECK EVERYTHING IS UPDATED CONGRATULATION YOU'RE DONE 💯

⚠️ **GitHub.com Fallback** ⚠️