Skip to content

Pushing changes to ViewTouch

No0ne558 edited this page Oct 24, 2025 · 3 revisions

πŸš€ Pushing ViewTouch Code Changes to GitHub

πŸ“š Git Learning Resources

πŸƒβ€β™‚οΈ Quick Start

A simple git tutorial for getting started

πŸ“– In-Depth Understanding

A more detailed understanding of git

🎯 Jack's Favorite

Git tricks, tips & workflows


πŸ“‹ Prerequisites

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


πŸ”„ Step-by-Step Git Workflow

1. πŸ“Š Check Status

git status

Purpose: Lists changed source files and provides guidance on next steps

2. πŸ” Review Changes (Optional)

git diff

Purpose: Shows detailed code changes before committing

3. βž• Stage Files for Commit

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


↩️ Unstaging Files

Option A: Reset Specific Files

git reset HEAD <filename>

Purpose: Unstage specific files while keeping changes

Option B: Stash All Changes

git stash

Purpose: Temporarily save all changes (can restore later with git stash pop)


πŸ’Ύ Committing Changes

Method 1: Interactive Commit

git commit

Opens text editor for entering commit message explaining the changes

Method 2: One-Line Commit

git commit -m 'Your descriptive commit message'

Direct commit with message (preferred for simple changes)


πŸ“€ Pushing to GitHub

Update Local Repository

You've now updated your local copy (typically the "master" branch).

Push to Remote

git push

Prompts for:

  • Username
  • Password (or personal access token)

Specific Push Commands

# Push to origin's master branch
git push origin master

# Push to main branch on GitHub
git push origin main

πŸŽ’ Stashing Changes

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

πŸ” Reviewing Differences

Compare Local vs Remote

git log HEAD..origin/master

Purpose: Review differences between your local HEAD and the remote origin/master branch


πŸ“ Best Practices for ViewTouch

πŸ’¬ Commit Messages

  • 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

🌿 Branch Management

  • 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)

πŸ”„ Staying Updated

  • Pull regularly to stay current with upstream changes
  • Resolve conflicts locally before pushing
  • Test builds after pulling changes

πŸ› Before Pushing

  • βœ… 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.

Clone this wiki locally