A friendly, beginner-oriented guide to working with this repository.
- Git = Version control system (tracks changes to your code)
- GitHub = Website that hosts Git repositories
- Repository (repo) = A project's folder with all its code and history
- Commit = A saved snapshot of your code at a point in time
- Branch = A separate line of development
- Merge = Combining changes from one branch into another
- Pull Request (PR) = Asking to merge your changes into the main code
# Clone the repository to your computer
git clone https://github.com/blairmichaelg/secbrain.git
cd secbrain# Always create a new branch for your work
git checkout -b my-feature-name
# Example:
git checkout -b fix-typo-in-readmeEdit files using your favorite editor, then check what changed:
git status # Shows which files changed
git diff # Shows exact changes# Stage your changes (prepare them for commit)
git add .
# Commit your changes (save them with a message)
git commit -m "Fix typo in README"# First time pushing this branch:
git push -u origin my-feature-name
# After that, just:
git push- Go to https://github.com/blairmichaelg/secbrain
- Click "Compare & pull request" (yellow banner)
- Add a description of what you changed
- Click "Create pull request"
git status # What's changed?
git log --oneline # Show recent commits
git branch # List all branchesgit add filename.py # Stage a specific file
git add . # Stage all changes
git commit -m "msg" # Commit with messagegit checkout -b new-branch # Create new branch
git checkout main # Switch to main
git branch -d old-branch # Delete a branchgit pull origin main # Get latest changes from maingit checkout main
git pull origin main
git checkout -b my-new-feature
# Make your changes...
git add .
git commit -m "Add new feature"
git push -u origin my-new-feature# Add more changes to the last commit
git add .
git commit --amend -m "Updated commit message"
# Or, undo the last commit but keep the changes
git reset --soft HEAD~1git checkout main
git pull origin main
git checkout my-feature
git merge main
# Fix any conflicts if they appear
git push# Option 1: Commit them
git add .
git commit -m "WIP: work in progress"
# Option 2: Stash them temporarily
git stash
git checkout other-branch
# Later, when you come back:
git checkout my-branch
git stash pop# Create a new branch from here
git branch correct-branch
# Go back to original branch and reset it
git checkout wrong-branch
git reset --hard origin/wrong-branch
# Continue on correct branch
git checkout correct-branch# Discard changes to a specific file
git checkout -- filename.py
# Discard ALL changes (be careful!)
git reset --hard HEAD# Keep the changes but undo the commit
git reset --soft HEAD~1
# Undo the commit AND discard the changes (careful!)
git reset --hard HEAD~1When two people change the same line of code, Git can't automatically decide which version to keep.
- Git marks the conflict in your file:
<<<<<<< HEAD
your version
=======
their version
>>>>>>> main- Edit the file to keep what you want:
the correct version- Tell Git you fixed it:
git add filename.py
git commit -m "Resolve merge conflict"
git pushGitHub automatically:
- ✅ Checks code style (linting)
- ✅ Runs type checker (currently non-blocking)
- ✅ Runs tests
- ✅ Generates coverage report
- In your PR, scroll down to the "Checks" section
- Click "Details" on any check to see logs
- ❌ Red X = Something failed
- ✅ Green checkmark = All good!
- Click "Details" to see what failed
- Fix the issue in your code
- Commit and push the fix
- CI runs automatically again
✅ Good:
Fix type error in exploit_agent.py
Add user authentication
Update README with installation instructions
❌ Bad:
fix
updates
asdfasdf
work
- Commit often - After each logical change
- Don't commit broken code - Test before committing
- One thing per commit - Don't mix multiple unrelated changes
✅ Good:
feature/add-login
bugfix/fix-crash-on-startup
docs/update-readme
❌ Bad:
mybranch
test
asdf
They're usually helpful! For example:
error: Your local changes would be overwritten by checkout
This means: "You have unsaved changes. Commit or stash them first."
git help <command> # Detailed help
git status # See current state
git log # See commit history- Open an issue on GitHub
- Ask in your Pull Request
- Check the full CONTRIBUTING.md guide
1. git checkout main
2. git pull origin main
3. git checkout -b my-feature
4. Make changes
5. git add .
6. git commit -m "message"
7. git push -u origin my-feature
8. Create PR on GitHub
9. Address feedback (repeat steps 4-7)
10. Merge on GitHub
Remember:
- Don't panic - Git can usually undo mistakes
- Commit often - Small commits are easier to manage
- Ask questions - No question is too basic
- Practice makes perfect - You'll get better with each PR
Next: Read the full Contributing Guide for more advanced topics!