Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ✨️ Guide to Managing GitHub Repositories Using the Terminal
- - File Size Limits on GitHub
- - Individual File Size Limit: 100 MB allowed to be pushed to the repository.
- - Git Large File Storage (LFS): For files larger than 100 MB, GitHub recommends using Git LFS, which supports files up to 2 GB. Git LFS requires additional setup and has its own storage and bandwidth limitations.
- ✨️ Login and push files from termianl:
- - Create and Set Up an SSH Key
- - Generate a New SSH Key
- - ssh-keygen -t ed25519 -C "[email protected]"
- -t ed25519: Specifies the type of key to create. ed25519 is a modern and secure choice.
- -C "[email protected]": Adds a label (your email) to the key for identification.
- ✨️ Copy publicey and paste in github ssh
- - cat ~/.ssh/id_ed25519.pub
- - Copy the entire output.
- ✨️ Add the SSH Key to GitHub
- - go to https://github.com/settings/keys or
- - Navigate to Settings > SSH and GPG keys.
- - Click New SSH key.
- - Paste your copied SSH key into the "Key" field.
- - Give it a descriptive title (e.g., "My Laptop Key").
- - Click Add SSH key.
- - Direct Link to Add SSH Key
- ✨️ Clone a Repository
- - To clone an existing repository using SSH
- - git clone [email protected]:username/repository.git
- - Replace username/repository with your repository’s path.
- - For example: git clone [email protected]:bobo2/store.git
- ✨️ Navigate into the cloned repository:
- - cd repository
- - To copy files into your repository directory:
- - cp /path/to/your/file ./file
- Stage the files for commit:
- - git add .
- - git status
- - git commit -m "Add description of changes"
- ✨️ Configure Git User Information
- - Set your global Git username and email:
- - git config --global user.email "[email protected]"
- - git config --global user.name "your profile name"
- ✨️ Push Changes to GitHub
- - git push origin main
- ✨️ Install GH
- - Install GitHub CLI
- - sudo apt install gh
- ✨️ Login and Authenticate with GitHub CLI
- - gh auth login
- - Choose SSH as the authentication method.
- - Follow the prompts to generate and paste a personal access token. You can create a token here.
- ✨️ Create a new public repository with:
- - gh repo create my-new-repo --public --description "A description of my new repository"
- - or
- - gh repo create test123 --public
- ✨️ Clone the New Repository and Add Files
- - gh repo clone temp-storage
- - or
- - git clone https://github.com/username/temp-storage.git
- ✨️ Navigate into the repository directory:
- - cd temp-storage
- - cp ~/files.txt .
- ✨️ Initialize and Push Your Code
- - git init
- - git add .
- - git status
- - git commit -m "Initial commit"
- - git remote add origin [email protected]:username/repository-name.git
- - git remote -v
- - git push -u origin main
- ✨️ Delete a File from a Repository
- - Navigate to your repository directory:
- - cd repository
- ✨️ Remove the file:
- - git rm path/to/file
- ✨️ Commit the change:
- - git commit -m "Remove file"
- ✨️ Push the changes to GitHub:
- - git push origin main
- ✨️ Delete a Repository Using GitHub CLI
- - Ensure you are authenticated with gh.
- - gh repo delete username/repository --confirm
- ✨️ List all repositories
- - gh repo list username
- Work with existing repository
- - check for remote (working repository)
- - git remote -v
- - Change remote
- - cd test-repository
- - gh repo fork
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement