Git & GitHub
Git: version control — track changes, go back, collaborate, branches for testing without affecting main.
GitHub: hosting platform — stores code online, collaborates.
git init
git add .
git commit -m 'message'
git push -u origin main
git clone <url>
git status
git log
git branch / git branch <name>
git checkout <branch> / git checkout -b <new>
git pull origin develop
git stash
git revert <commit>
git pull origin develop before push, resolve manually. Merge conflicts: GitHub cannot decide which version to keep. Resolve conflicts manually in editor (choose correct logic), stage and commit again. Avoid with small frequent commits and PRs.Large files: GitHub rejects files > 100MB — do not commit large data files.
Accidental push to main: bypasses code review and may break production. Solution: branch protection rules — require PR before merge, block direct push to main.
Secrets pushed accidentally: credentials can be exploited. Never hardcode; store in AWS Secrets Manager. If pushed, rotate immediately.
More commands from doc: git rm removes files, git reset undo commits / unstage files, git pull downloads updates, git add <file> stages specific files.
Credentials stored in AWS Secrets Manager (all connection details).
Secrets Manager
All connection and credential details in AWS stored in AWS Secrets Manager, not hardcoded.
Status Codes
From file: 1xx informational, 2xx success, 3xx redirection, 4xx client error, 5xx server error
status_codes = {100:"Informational",200:"Success",300:"Redirection",400:"Client Error",500:"Server Error"}
for code, desc in status_codes.items():
print(f"{code}: {desc}")