squirrelworks

Setting Up for Success: Git Initialization

1. Configuration and Identity

Set your identifying information across all local repositories so your commits are properly attributed 1:

git config --global user.name "Your Name"
git config --global user.email "your@email.com"
2. Creating Repositories

Initialize an existing directory as a new Git repository:

git init

Clone a repository from a GitHub link:

git clone [url]

Staging and Snapshots

1. Managing the Index

Prepare your files for the next commit by "staging" them in the index 2:

git add [file]

Unstage a file while keeping the changes in your working directory:

git reset [file]

Check the current status of your working tree and staging area:

git status
2. Committing to History

Commit your staged content as a new snapshot with a descriptive comment:

git commit -m "[descriptive comment]"

Navigating Branches and State

1. Branching Workflows

Create a new local branch to start a fresh feature without affecting the main line 3:

git branch [branch-name]

Switch your working directory to a specific branch:

git checkout [branch-name]
2. Handling Uncommitted Work

Sometimes you need to switch branches but aren't ready to commit. Stashing allows you to "pause" your progress safely.

Save all current changes into a temporary storage area:

git stash

Re-apply your stashed changes to the current branch:

git stash pop

Advanced Recovery and Refinement

1. Undoing Mistakes

Create a new commit that undoes the changes of a previous one:

git revert [SHA]
Pro Tip: Reset vs Revert

While reset is great for fixing local staging errors, revert is the safe way to fix mistakes on shared remote branches because it doesn't "rewrite" the existing history.

2. Picking Specific Changes

Apply the changes from a specific commit on another branch to your current one:

git cherry-pick [SHA]

Project Milestone: Collaborative Mastery

1. Remote Synchronization

Fetch all branches from the remote repository:

git fetch [alias]

Push local branch commits to the remote repository branch:

git push [alias] [branch]

Fetch and merge any remote commits from the tracking branch:

git pull
2. Merging and Conflict Resolution

Merge a remote branch into your current local branch:

git merge [alias]/[branch]
Mastered the commands? Now see how we built the actual bridge.
Read: The "Libcrypto" Reconstruction →


Accessibility
 --overview

Agile
 --DevOps overview
 --Principles

API
 --REST best practices
 --REST demo
 --REST vs RPC
 --Wikipedia API

Blockchain
 --overview

Cloud
 --AWS overview

CSS/HTML
 --Bootstrap carousel
 --Grid demo
 --markdown demo

Electricity
 --fundamentals

Encoding
 --Overview

Ergonomics
 --Desk configuration
 --Device fleet
 --Input device array
 --keystroke mechanics
 --Phones & RSI

ERP
 --Anthology overview
 --Ellucian Banner
 --Higher Ed ERP Simulation Lab
 --PeopleSoft Campus Solutions
 --PESC standards
 --Slate data model

Git
 --syntax overview
 --troubleshooting libcrypto

Hardware
 --Device fleet
 --Homelab diagram

Java
 --Fundamentals

Javascript
 --Advanced Interaction: jQuery & UI Frameworks
 --input prompt demo
 --misc demo
 --Time and Date functions
 --Vue demo

Linux
 --grep demo
 --HCI and Proxmox
 --Proxmox install
 --xammp ftp server

Mail flow
 --DKIM, SPF, DMARC
 --MAPI

Microsoft
 --AZ-800: Administering Windows Server Hybrid Core Infrastructure
 --BAT scripting
 --Group Policy
 --IIS
 --robocopy
 --Server 2022 setup - Virtualbox

Misc
 --Applications
 --regex
 --Resources
 --Sustainable Computing
 --Terminology
 --Tribute to Computer Scientists

Networks
 --BGP Peering & Security Hardening Lab
 --CCNA Lammle Study Guide
 --Cisco 1921/K9 router
 --routing protocols
 --throughput calculations

PHP/SQL
 --Cookies
 --database interaction
 --demo, OSI Layers quiz
 --Foreign key constraint demo
 --fundamentals
 --MySQL and PHPmyAdmin setup
 --pagination
 --security
 --session variables
 --SQL fundamentals
 --structures
 --Tables display

Python
 --fundamentals

Security
 --Overview- GRC (Governance, Risk, and Compliance)
 --Security Blog
 --SSH fundamentals

Serialization
 --JSON demo
 --YAML demo