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