{"id":28919311,"url":"https://github.com/sakethakella/git_learn","last_synced_at":"2026-05-10T02:10:55.206Z","repository":{"id":299377146,"uuid":"1002781500","full_name":"sakethakella/git_learn","owner":"sakethakella","description":"About Git and Github for Windows ","archived":false,"fork":false,"pushed_at":"2025-06-16T07:52:33.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-16T08:47:52.686Z","etag":null,"topics":["git","github","github-actions"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sakethakella.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-16T06:16:20.000Z","updated_at":"2025-06-16T07:55:21.000Z","dependencies_parsed_at":"2025-06-16T08:47:56.163Z","dependency_job_id":"eb8bbbcd-9164-4717-bf28-bec918a0d4e9","html_url":"https://github.com/sakethakella/git_learn","commit_stats":null,"previous_names":["sakethakella/git_learn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sakethakella/git_learn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakethakella%2Fgit_learn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakethakella%2Fgit_learn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakethakella%2Fgit_learn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakethakella%2Fgit_learn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakethakella","download_url":"https://codeload.github.com/sakethakella/git_learn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakethakella%2Fgit_learn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261229093,"owners_count":23127555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","github","github-actions"],"created_at":"2025-06-22T03:05:59.955Z","updated_at":"2026-05-10T02:10:55.167Z","avatar_url":"https://github.com/sakethakella.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git \u0026 GitHub Complete Guide for Windows\n\nA comprehensive guide to Git version control and GitHub collaboration specifically for Windows users.\n\n## Table of Contents\n\n- [What is Git?](#what-is-git)\n- [What is GitHub?](#what-is-github)\n- [Windows Installation](#windows-installation)\n- [Initial Setup](#initial-setup)\n- [Basic Git Commands](#basic-git-commands)\n- [Working with Branches](#working-with-branches)\n- [Remote Repositories](#remote-repositories)\n- [GitHub Workflow](#github-workflow)\n- [Advanced Git Commands](#advanced-git-commands)\n- [Windows-Specific Tips](#windows-specific-tips)\n- [Git Best Practices](#git-best-practices)\n- [Common Scenarios](#common-scenarios)\n- [Troubleshooting](#troubleshooting)\n\n## What is Git?\n\nGit is a distributed version control system that tracks changes in files and coordinates work among multiple people. It allows you to:\n\n- Track file changes over time\n- Revert to previous versions\n- Work on different features simultaneously\n- Collaborate with others without conflicts\n- Maintain a complete history of your project\n\n## What is GitHub?\n\nGitHub is a cloud-based hosting service for Git repositories. It provides:\n\n- Remote storage for your Git repositories\n- Collaboration tools (pull requests, issues, discussions)\n- Project management features\n- CI/CD integration\n- Documentation hosting (GitHub Pages)\n\n## Windows Installation\n\n### Step 1: Download Git for Windows\n\n1. Visit [git-scm.com](https://git-scm.com/)\n2. Click \"Download for Windows\"\n3. The download will start automatically\n\n### Step 2: Install Git\n\n1. Run the downloaded `.exe` file\n2. **Recommended installation options:**\n   - **Select Components:** Check \"Git Bash Here\" and \"Git GUI Here\"\n   - **Default Editor:** Choose your preferred editor (VS Code recommended)\n   - **PATH Environment:** Select \"Git from the command line and also from 3rd-party software\"\n   - **HTTPS Transport:** Use the OpenSSL library\n   - **Line Ending Conversions:** \"Checkout Windows-style, commit Unix-style line endings\"\n   - **Terminal Emulator:** Use MinTTY\n   - **Git Pull Behavior:** Default (fast-forward or merge)\n   - **Credential Helper:** Git Credential Manager Core\n   - **Extra Options:** Enable file system caching\n\n### Step 3: Verify Installation\n\nOpen Command Prompt or PowerShell and run:\n\n```cmd\ngit --version\n```\n\n### Available Interfaces on Windows\n\n- **Git Bash:** Unix-like terminal (recommended for Git commands)\n- **Command Prompt:** Windows native terminal\n- **PowerShell:** Enhanced Windows terminal\n- **Git GUI:** Graphical interface for Git operations\n\n## Initial Setup\n\nConfigure your identity (required for commits). Open Git Bash, Command Prompt, or PowerShell:\n\n```bash\n# Set your name and email\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your.email@example.com\"\n\n# Set default branch name\ngit config --global init.defaultBranch main\n\n# Set default editor (Windows options)\ngit config --global core.editor \"code --wait\"        # VS Code\ngit config --global core.editor \"notepad\"            # Notepad\ngit config --global core.editor \"'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin\"  # Notepad++\n\n# Configure line endings for Windows\ngit config --global core.autocrlf true\n\n# View your configuration\ngit config --list\n\n# View specific configuration\ngit config user.name\ngit config user.email\n```\n\n### Windows-Specific Configuration\n\n```bash\n# Set credential helper (usually set during installation)\ngit config --global credential.helper manager-core\n\n# Configure file permissions (Windows doesn't track execute permissions)\ngit config --global core.filemode false\n\n# Configure safe directory (if needed for shared drives)\ngit config --global --add safe.directory '*'\n```\n\n## Basic Git Commands\n\n### Repository Initialization\n\n```bash\n# Create a new repository\ngit init\n\n# Clone an existing repository\ngit clone https://github.com/username/repository-name.git\ngit clone git@github.com:username/repository-name.git  # SSH\n```\n\n### File Operations\n\n```bash\n# Check repository status\ngit status\n\n# Add files to staging area\ngit add filename.txt           # Add specific file\ngit add .                      # Add all files\ngit add *.js                   # Add all JavaScript files\ngit add src/                   # Add all files in src directory\n\n# Remove files from staging area\ngit reset filename.txt         # Unstage specific file\ngit reset                      # Unstage all files\n\n# Commit changes\ngit commit -m \"Your commit message\"\ngit commit -am \"Add and commit in one step\"  # For tracked files only\n\n# View commit history\ngit log\ngit log --oneline             # Compact view\ngit log --graph               # Show branch graph\ngit log -n 5                  # Show last 5 commits\n```\n\n### File Status and Differences\n\n````bash\n# Show differences\n## Git Best Practices\n\n### Commit Messages\n```bash\n# Good commit message format:\n# \u003ctype\u003e: \u003csubject\u003e\n#\n# \u003cbody\u003e\n#\n# \u003cfooter\u003e\n\n# Examples:\ngit commit -m \"feat: add user authentication\"\ngit commit -m \"fix: resolve login button alignment issue\"\ngit commit -m \"docs: update README with installation instructions\"\n\n# Types: feat, fix, docs, style, refactor, test, chore\n````\n\n### Branching Strategy\n\n```bash\n# Use descriptive branch names\ngit checkout -b feature/user-authentication\ngit checkout -b bugfix/login-form-validation\ngit checkout -b hotfix/security-patch\n\n# Keep branches focused on single features\n# Delete merged branches to keep repository clean\n```\n\n### General Best Practices\n\n- Commit often, push regularly\n- Write meaningful commit messages\n- Review changes before committing (`git diff`)\n- Use `.gitignore` to exclude unnecessary files\n- Keep commits atomic (one logical change per commit)\n- Test before pushing to shared branches\n- Use pull requests for code review\n\n## Common Scenarios\n\n### Starting a New Project\n\n```bash\n# Method 1: Start locally\nmkdir my-project\ncd my-project\ngit init\necho \"# My Project\" \u003e README.md\ngit add README.md\ngit commit -m \"Initial commit\"\ngit remote add origin https://github.com/username/my-project.git\ngit push -u origin main\n\n# Method 2: Start on GitHub\n# 1. Create repository on GitHub\n# 2. Clone it locally\ngit clone https://github.com/username/my-project.git\ncd my-project\n```\n\n### Contributing to Open Source\n\n```bash\n# 1. Fork the repository on GitHub\n# 2. Clone your fork\ngit clone https://github.com/yourusername/project.git\ncd project\n\n# 3. Add upstream remote\ngit remote add upstream https://github.com/originalowner/project.git\n\n# 4. Create feature branch\ngit checkout -b feature/improvement\n\n# 5. Make changes, commit, and push\ngit add .\ngit commit -m \"Add improvement feature\"\ngit push origin feature/improvement\n\n# 6. Create pull request on GitHub\n# 7. Keep your fork updated\ngit checkout main\ngit pull upstream main\ngit push origin main\n```\n\n### Handling Merge Conflicts (Windows)\n\n```bash\n# When conflicts occur during merge\ngit merge feature-branch\n# Auto-merging file.txt\n# CONFLICT (content): Merge conflict in file.txt\n\n# Open conflicted file in your editor\n# Look for conflict markers:\n# \u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD\n# Your changes\n# =======\n# Their changes\n# \u003e\u003e\u003e\u003e\u003e\u003e\u003e feature-branch\n\n# Resolve conflicts manually, then:\ngit add file.txt\ngit commit -m \"Resolve merge conflict\"\n```\n\n### Working with Large Files\n\n```bash\n# Install Git LFS (Large File Storage)\n# Download from: https://git-lfs.github.io/\n\n# Initialize LFS in repository\ngit lfs install\n\n# Track large file types\ngit lfs track \"*.psd\"\ngit lfs track \"*.zip\"\ngit lfs track \"*.exe\"\n\n# Add .gitattributes\ngit add .gitattributes\ngit commit -m \"Add LFS tracking\"\n\n# Add and commit large files normally\ngit add large-file.zip\ngit commit -m \"Add large file\"\ngit push origin main\n```\n\n## Troubleshooting\n\n### Common Windows Issues\n\n#### Permission Errors\n\n```bash\n# Run Git Bash as Administrator if needed\n# Or configure safe directories:\ngit config --global --add safe.directory '*'\n```\n\n#### Path Too Long Errors\n\n```bash\n# Enable long path support\ngit config --global core.longpaths true\n```\n\n#### Line Ending Issues\n\n```bash\n# Fix line ending configuration\ngit config --global core.autocrlf true\n\n# Reset all files with correct line endings\ngit rm --cached -r .\ngit reset --hard\n```\n\n#### SSH Connection Issues\n\n```bash\n# Test SSH connection\nssh -T git@github.com\n\n# Start SSH agent (Git Bash)\neval \"$(ssh-agent -s)\"\nssh-add ~/.ssh/id_ed25519\n\n# Use HTTPS instead of SSH if needed\ngit remote set-url origin https://github.com/username/repository.git\n```\n\n### General Troubleshooting\n\n```bash\n# Check Git status\ngit status\n\n# Check remote URLs\ngit remote -v\n\n# Check configuration\ngit config --list\n\n# Reset to last known good state\ngit reset --hard HEAD\n\n# Clean untracked files\ngit clean -fd\n\n# View detailed log\ngit log --oneline --graph --decorate --all\n```\n\n### Getting Help\n\n```bash\n# Built-in help\ngit help\ngit help command-name\ngit command-name --help\n\n# Quick reference\ngit status\ngit log --oneline\n```\n\n## Useful Resources\n\n- **Official Git Documentation:** [git-scm.com/doc](https://git-scm.com/doc)\n- **GitHub Docs:** [docs.github.com](https://docs.github.com)\n- **Interactive Git Tutorial:** [learngitbranching.js.org](https://learngitbranching.js.org)\n- **Git Cheat Sheet:** [education.github.com/git-cheat-sheet](https://education.github.com/git-cheat-sheet-education.pdf)\n- **Atlassian Git Tutorials:** [atlassian.com/git/tutorials](https://www.atlassian.com/git/tutorials)\n\n## Quick Reference Commands\n\n```bash\n# Repository setup\ngit init                      # Initialize repository\ngit clone \u003curl\u003e              # Clone repository\n\n# Basic operations\ngit status                   # Check status\ngit add \u003cfile\u003e               # Stage file\ngit commit -m \"message\"      # Commit changes\ngit push                     # Push to remote\ngit pull                     # Pull from remote\n\n# Branching\ngit branch                   # List branches\ngit checkout -b \u003cbranch\u003e     # Create and switch branch\ngit merge \u003cbranch\u003e           # Merge branch\n\n# Information\ngit log                      # View commit history\ngit diff                     # View changes\ngit remote -v                # View remotes\n```\n\n---\n\n_This guide covers the essential Git and GitHub commands for Windows users. Practice these commands regularly to become proficient with version control!_\n\nBranches allow you to work on different features simultaneously without affecting the main codebase.\n\n```bash\n# List branches\ngit branch                    # Local branches\ngit branch -r                 # Remote branches\ngit branch -a                 # All branches\n\n# Create and switch to new branch\ngit checkout -b feature-name\ngit switch -c feature-name    # Modern alternative\n\n# Switch between branches\ngit checkout main\ngit switch main               # Modern alternative\n\n# Create branch without switching\ngit branch feature-name\n\n# Delete branch\ngit branch -d feature-name    # Safe delete (only if merged)\ngit branch -D feature-name    # Force delete\n\n# Rename current branch\ngit branch -m new-branch-name\n\n# Merge branch into current branch\ngit merge feature-name\n\n# Rebase current branch onto another\ngit rebase main\n```\n\n## Remote Repositories\n\n### Adding and Managing Remotes\n\n```bash\n# Add remote repository\ngit remote add origin https://github.com/username/repository-name.git\n\n# View remotes\ngit remote -v\n\n# Change remote URL\ngit remote set-url origin https://github.com/username/new-repository.git\n\n# Remove remote\ngit remote remove origin\n```\n\n### Pushing and Pulling Changes\n\n```bash\n# Push to remote repository\ngit push origin main          # Push main branch\ngit push origin feature-name  # Push specific branch\ngit push -u origin main       # Set upstream and push\ngit push --all               # Push all branches\n\n# Pull changes from remote\ngit pull origin main         # Pull specific branch\ngit pull                     # Pull current branch\n\n# Fetch changes without merging\ngit fetch origin\ngit fetch --all              # Fetch all remotes\n```\n\n## GitHub Workflow\n\n### Setting up SSH Keys (Windows)\n\n```bash\n# Generate SSH key (in Git Bash)\nssh-keygen -t ed25519 -C \"your.email@example.com\"\n\n# Start SSH agent\neval \"$(ssh-agent -s)\"\n\n# Add SSH key to agent\nssh-add ~/.ssh/id_ed25519\n\n# Copy public key to clipboard (Git Bash)\ncat ~/.ssh/id_ed25519.pub | clip\n\n# Or manually copy from:\n# C:\\Users\\YourUsername\\.ssh\\id_ed25519.pub\n```\n\nAdd the copied key to your GitHub account: Settings → SSH and GPG keys → New SSH key\n\n### Basic GitHub Workflow\n\n```bash\n# 1. Fork repository on GitHub (click Fork button)\n\n# 2. Clone your fork\ngit clone git@github.com:yourusername/repository-name.git\n\n# 3. Add upstream remote\ngit remote add upstream git@github.com:originaluser/repository-name.git\n\n# 4. Create feature branch\ngit checkout -b feature-name\n\n# 5. Make changes and commit\ngit add .\ngit commit -m \"Add new feature\"\n\n# 6. Push to your fork\ngit push origin feature-name\n\n# 7. Create Pull Request on GitHub\n\n# 8. Keep your fork updated\ngit checkout main\ngit pull upstream main\ngit push origin main\n```\n\n## Advanced Git Commands\n\n### Viewing History and Changes\n\n```bash\n# Advanced log options\ngit log --oneline --graph --all\ngit log --author=\"Author Name\"\ngit log --since=\"2023-01-01\"\ngit log --until=\"2023-12-31\"\ngit log --grep=\"bug fix\"\ngit log -p                   # Show patches/diffs\n\n# Show specific commit\ngit show commit-hash\n\n# Show file history\ngit log --follow filename.txt\n```\n\n### Undoing and Reverting\n\n```bash\n# Undo last commit (keep changes)\ngit reset --soft HEAD~1\n\n# Undo last commit (discard changes)\ngit reset --hard HEAD~1\n\n# Undo specific file changes\ngit checkout -- filename.txt\ngit restore filename.txt     # Modern alternative\n\n# Revert a commit (creates new commit)\ngit revert commit-hash\n\n# Interactive rebase (edit commit history)\ngit rebase -i HEAD~3\n```\n\n### Stashing Changes\n\n```bash\n# Save current changes temporarily\ngit stash\ngit stash save \"work in progress\"\n\n# List stashes\ngit stash list\n\n# Apply stash\ngit stash apply              # Keep stash\ngit stash pop                # Apply and remove stash\n\n# Apply specific stash\ngit stash apply stash@{2}\n\n# Delete stash\ngit stash drop stash@{0}\ngit stash clear              # Delete all stashes\n```\n\n### Tags\n\n```bash\n# Create lightweight tag\ngit tag v1.0.0\n\n# Create annotated tag\ngit tag -a v1.0.0 -m \"Version 1.0.0\"\n\n# List tags\ngit tag\ngit tag -l \"v1.*\"\n\n# Push tags\ngit push origin v1.0.0\ngit push origin --tags       # Push all tags\n\n# Delete tag\ngit tag -d v1.0.0            # Local\ngit push origin --delete v1.0.0  # Remote\n```\n\n## Windows-Specific Tips\n\n### Using Different Terminals\n\n```bash\n# Git Bash (recommended for Git operations)\n# - Unix-like environment\n# - Better Git integration\n# - Supports SSH agent\n\n# Command Prompt\n# - Native Windows terminal\n# - Limited features compared to Git Bash\n\n# PowerShell\n# - Enhanced Windows terminal\n# - Good Git support with modules\n# - Install Posh-Git for better experience:\n# Install-Module posh-git -Scope CurrentUser\n```\n\n### File Path Considerations\n\n```bash\n# Windows uses backslashes, Git uses forward slashes\n# Git automatically handles path conversion\n\n# Avoid spaces in file/folder names when possible\n# If needed, use quotes:\ngit add \"file with spaces.txt\"\n\n# Long path support (Windows 10+)\ngit config --global core.longpaths true\n```\n\n### Line Ending Configuration\n\n```bash\n# Windows (CRLF) to Unix (LF) conversion\ngit config --global core.autocrlf true\n\n# Check current setting\ngit config core.autocrlf\n\n# If working only on Windows\ngit config --global core.autocrlf false\n```\n\n### GUI Tools for Windows\n\n- **GitHub Desktop:** User-friendly GUI application\n- **Git GUI:** Built-in with Git installation\n- **SourceTree:** Advanced Git GUI by Atlassian\n- **TortoiseGit:** Windows Explorer integration\n- **GitKraken:** Commercial Git client with visual interface\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakethakella%2Fgit_learn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakethakella%2Fgit_learn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakethakella%2Fgit_learn/lists"}