📕
TIC
  • Tehnologii ale InformaÅ£iei ÅŸi ComunicaÅ£iilor (TIC)
  • Basic web principles
    • How web pages work
    • The pillars of a web page
    • Extra: Getting Started with GitHub
  • Basic HTML
    • Description and Basic Syntax
    • Extra resources
  • Basic CSS
    • Description and Basic Syntax
    • Advanced Positioning
    • Extra Resources
  • Basic Javascript
    • Description and basic syntax
    • The Document Object Model
    • Extra Resources
    • Basic assignment
    • The Color Game
  • Advanced Javascript
    • Runtime Engine, Callstack, Scope
    • ES6
  • Advanced Javascript 2
  • Programming paradigms
  • OOP Javascript
  • Functional Programming
  • OOP vs. Functional Programming
  • Asynchronous Javascript
  • Backend Javascript
    • NodeJS
    • ExpressJS
    • REST APIs
    • Authentication and Authorization
  • Firebase
    • NoSQL Databases
    • Database as a Service
    • Google Cloud Firestore
    • CRUD operations
    • Securing your database
  • Basic VueJS
  • Agenda: VueJS and Frontend Frameworks
  • Single Page Applications
  • VueJS basic syntax
  • Vue Components
  • Advanced VueJS
  • Advanced apps with Vue CLI
  • Vue Router
  • SPA State Management - Vuex
  • Composition API
  • Evaluation
    • Final Individual assignment
Powered by GitBook
On this page
  • 1. Create a GitHub Account
  • 2. Install Git on Your Computer
  • 3. Configure Git
  • 4. Basic GitHub Workflow
  • 5. Best Practices
  • 6. Additional Features to Explore
  • 7. Troubleshooting
  • 8. Getting Help
  • Setting up SSH Authentication for GitHub
  • 1. Check for Existing SSH Keys
  • 2. Generate a New SSH Key
  • 3. Start the SSH Agent
  • 4. Copy the SSH Public Key
  • 5. Add the SSH Key to GitHub
  • 6. Test Your SSH Connection
  • 7. Update Your Repository Remote URL

Was this helpful?

  1. Basic web principles

Extra: Getting Started with GitHub

PreviousThe pillars of a web pageNextDescription and Basic Syntax

Last updated 8 months ago

Was this helpful?

1. Create a GitHub Account

  • Go to

  • Click "Sign up"

  • Enter your email address

  • Create a password

  • Choose a username

  • Verify your email address

2. Install Git on Your Computer

Windows:

  • Download Git from

  • Run the installer with default settings

  • Open Git Bash to verify the installation: git --version

Mac:

  • Open Terminal

  • Install Homebrew if not installed: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  • Install Git: brew install git

  • Verify installation: git --version

Linux:

  • Open Terminal

  • For Ubuntu/Debian: sudo apt-get install git

  • For Fedora: sudo dnf install git

  • Verify installation: git --version

3. Configure Git

Open Terminal/Git Bash and run:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

4. Basic GitHub Workflow

Create a New Repository

  1. Click "+" in the top right corner of GitHub

  2. Select "New repository"

  3. Enter repository name

  4. Add description (optional)

  5. Choose public or private

  6. Initialize with README if desired

  7. Click "Create repository"

Clone a Repository

git clone https://github.com/username/repository.git

Basic Git Commands

# Check status of your repository
git status

# Add files to staging area
git add filename    # Add specific file
git add .           # Add all files

# Commit changes
git commit -m "Your commit message"

# Push changes to GitHub
git push origin main

# Pull changes from GitHub
git pull origin main

# Create and switch to a new branch
git checkout -b branch-name

# Switch between branches
git checkout branch-name

5. Best Practices

  • Write clear commit messages

  • Commit often

  • Use branches for new features

  • Keep your repository organized

  • Add a .gitignore file for files you don't want to track

  • Include a README.md with project information

6. Additional Features to Explore

  • Pull Requests

  • Issues

  • GitHub Projects

  • GitHub Pages

  • GitHub Actions

  • Discussions

  • Wiki

7. Troubleshooting

Common Issues:

  1. Authentication failures

    • Ensure your credentials are correct

    • Use SSH keys or personal access tokens for better security

  2. Merge conflicts

    • Pull the latest changes before pushing

    • Resolve conflicts manually when they occur

  3. Permission issues

    • Verify repository access rights

    • Check if you're using the correct remote URL

8. Getting Help

  • GitHub Community Forum

  • Stack Overflow

  • GitHub Support

Setting up SSH Authentication for GitHub

1. Check for Existing SSH Keys

First, check if you already have any SSH keys:

ls -al ~/.ssh

2. Generate a New SSH Key

If you don't have an existing key (or want to create a new one):

ssh-keygen -t ed25519 -C "your_email@example.com"
  • Press Enter to accept the default file location

  • Enter a secure passphrase when prompted (recommended)

3. Start the SSH Agent

# Start the ssh-agent in the background
eval "$(ssh-agent -s)"

# Add your SSH private key to the ssh-agent
ssh-add ~/.ssh/id_ed25519

4. Copy the SSH Public Key

On Windows (PowerShell):

Get-Content ~/.ssh/id_ed25519.pub | Set-Clipboard

On Mac:

pbcopy < ~/.ssh/id_ed25519.pub

On Linux:

cat ~/.ssh/id_ed25519.pub

(Then manually copy the output)

5. Add the SSH Key to GitHub

  1. Go to GitHub.com and log in

  2. Click your profile photo → Settings

  3. Click "SSH and GPG keys" in the sidebar

  4. Click "New SSH key"

  5. Give your key a descriptive title (e.g., "Personal Laptop")

  6. Paste your key into the "Key" field

  7. Click "Add SSH key"

6. Test Your SSH Connection

ssh -T git@github.com
  • You should see a message like: "Hi username! You've successfully authenticated..."

7. Update Your Repository Remote URL

If you were using HTTPS before, update to SSH:

# Check current remote
git remote -v

# Update to SSH URL
git remote set-origin git@github.com:username/repository.git

GitHub Docs:

github.com
git-scm.com
docs.github.com