A hands-on guide to version control with Git – from initialising repos and committing changes to branching, merging, and collaborating on GitHub in engineering workflows.
git config, SSH keys, and connecting to GitHub for the first time.
git init, add, commit, status – tracking changes in your project.
git branch, checkout, merge, rebase – parallel development workflows.
git remote, fetch, pull, push – syncing with GitHub and origin.
git reset, revert, restore, stash – safely rolling back mistakes.
Using Git with GitHub Actions, Azure DevOps, and deployment workflows.
# Set global identity git config --global user.name "Olisaeloka Michael" git config --global user.email "your@email.com" # Initialise a new repo git init my-project cd my-project # Clone an existing repo git clone https://github.com/olisamichaeltech/repo.git
# Check what has changed git status # Stage all changes git add . # Commit with a message git commit -m "feat: add nginx config" # Push to remote branch git push origin main
# Create and switch to a new branch git checkout -b feature/azure-arc-setup # List all branches git branch -a # Merge a branch into main git checkout main git merge feature/azure-arc-setup # Delete branch after merge git branch -d feature/azure-arc-setup
# Discard unstaged changes git restore filename.sh # Undo last commit (keep changes) git reset --soft HEAD~1 # Stash work in progress git stash git stash pop