X Tutup
Skip to content

Latest commit

 

History

History
97 lines (75 loc) · 2.37 KB

File metadata and controls

97 lines (75 loc) · 2.37 KB

GitHub Repository Cleanup Guide

This guide provides step-by-step instructions for downloading, cleaning, and re-uploading your GitHub repository.


Step 1: Download Your Repository

Option A: Using Git

  1. Open a terminal on your device (e.g., in PythonEditor or another app).
  2. Clone the repository:
    git clone https://github.com/Okeamah/<repo-name>.git
    cd <repo-name>

Option B: Download as ZIP

  1. Open your browser and navigate to your repository on GitHub.
  2. Click the green "Code" button and select "Download ZIP".
  3. Extract the ZIP file to a folder on your device.

Step 2: Clean Up Your Repository

  1. Navigate to the extracted repository folder (for ZIP) or the cloned folder (for Git).
  2. Remove unwanted files or directories:
    • Using a file manager, delete files manually.
    • Using Git, run:
      rm <file-name>
  3. Update content like the README.md file if needed.

Step 3: Re-upload Your Repository

Option A: Using Git

  1. Stage and commit your changes:
    git add .
    git commit -m "Cleaned up repository"
  2. Push changes back to GitHub:
    git push

Option B: Using ZIP

  1. Compress the cleaned folder into a new ZIP file.
  2. Open your browser and go to your GitHub repository.
  3. Drag and drop the cleaned files (not the ZIP) into the repository interface.
  4. Commit the changes.

Step 4: Optional - Clean Up Branches

Delete Old Branches Locally

  1. View all branches:
    git branch
  2. Delete unwanted branches:
    git branch -d <branch-name>

Delete Old Branches Remotely

  1. View remote branches:
    git branch -r
  2. Delete unwanted remote branches:
    git push origin --delete <branch-name>

Step 5: Backup Your Cleaned Repository

  1. Rename your current repository on GitHub (e.g., to repo-name-old):
    • Go to Settings in the repository.
    • Rename it under Repository name.
  2. Create a new repository for the cleaned version (e.g., repo-name-clean).
  3. Link your cleaned local repository to the new remote:
    git remote set-url origin https://github.com/Okeamah/<new-repo-name>.git
    git push -u origin main

Follow these steps carefully. If you need additional help, feel free to ask!

X Tutup