-
Notifications
You must be signed in to change notification settings - Fork 52
Pushing changes to ViewTouch
A simple git tutorial for getting started
A more detailed understanding of git
This guide assumes you have:
- β A local cloned ViewTouch repository
- β Made source file modifications
- π
.gitignore
configured to ignore/build
and/dat
directories
Note: Learn more about
.gitignore
at GitHub's ignoring files guide
git status
Purpose: Lists changed source files and provides guidance on next steps
git diff
Purpose: Shows detailed code changes before committing
git add <filename>
# Or add multiple files:
git add file1.cc file2.hh
# Or add all changes:
git add .
Purpose: Stage changed source files for committing
git reset HEAD <filename>
Purpose: Unstage specific files while keeping changes
git stash
Purpose: Temporarily save all changes (can restore later with git stash pop
)
git commit
Opens text editor for entering commit message explaining the changes
git commit -m 'Your descriptive commit message'
Direct commit with message (preferred for simple changes)
You've now updated your local copy (typically the "master" branch).
git push
Prompts for:
- Username
- Password (or personal access token)
# Push to origin's master branch
git push origin master
# Push to main branch on GitHub
git push origin main
git stash
Purpose:
- Temporarily saves uncommitted changes
- Allows clean
git pull
operations - Preserves work not yet ready to push
Restore stashed changes:
git stash pop
git log HEAD..origin/master
Purpose: Review differences between your local HEAD and the remote origin/master branch
- Be descriptive about what changed and why
- Reference issue numbers if applicable (e.g., "Fix #123: Resolve memory leak in order processing")
- Keep first line under 50 characters
- Work in feature branches for significant changes
- Merge to master/main only after testing
-
Use descriptive branch names (e.g.,
feature/kitchen-video-display
,bugfix/printer-timeout
)
- Pull regularly to stay current with upstream changes
- Resolve conflicts locally before pushing
- Test builds after pulling changes
- β
Build successfully (
make
) - β Test functionality
- β Run any existing tests
- β Check for linting errors
- β
Review changes with
git diff
This workflow ensures clean, well-documented contributions to the ViewTouch codebase while maintaining code quality and collaboration standards.