Skip to content

Latest commit

 

History

History
257 lines (198 loc) · 5.6 KB

File metadata and controls

257 lines (198 loc) · 5.6 KB

Git Commit & Push Guide - Multi-Platform

Quick Summary

You have 4 project modules that need to be committed:

  1. ✅ DeeplabV3plus + Resnet50
  2. ✅ DeeplabV3plus+Efficientnet
  3. ✅ Duality AI Seg Mod
  4. ✅ OMEN_Segformer + DeeplabV3plus + Efficientnet

All are currently staged and ready for commit.


📱 PLATFORM-SPECIFIC INSTRUCTIONS

🍎 macOS Instructions

Step 1: Verify All Files Are Staged

cd "/Users/$(whoami)/Desktop/Duality Seg Mod"
git status

Step 2: Commit All Changes

git commit -m "Add all four segmentation model projects"

Step 3: Push to GitHub

git push origin main

Step 4: Verify Remote Repository

git log --oneline -5
git branch -vv

Troubleshooting for macOS:

  • If you get "command not found: git", install from git-scm.com
  • If SSH key issues occur: ssh-add ~/.ssh/id_rsa (then add passphrase)
  • For CRLF warnings: git config --global core.autocrlf input

🐧 Linux Instructions

Step 1: Verify All Files Are Staged

cd ~/Desktop/Duality\ Seg\ Mod
git status

Step 2: Commit All Changes

git commit -m "Add all four segmentation model projects"

Step 3: Push to GitHub

git push origin main

Step 4: Verify Remote Repository

git log --oneline -5
git branch -vv

Troubleshooting for Linux:

  • If git not installed:
    • Ubuntu/Debian: sudo apt-get install git
    • Fedora/RHEL: sudo dnf install git
    • Arch: sudo pacman -S git
  • SSH key setup: ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  • Add SSH key to GitHub: cat ~/.ssh/id_rsa.pub (copy and paste in GitHub Settings)

🪟 Windows Instructions

Option A: Using PowerShell (Recommended)

cd "C:\Users\YourUsername\Desktop\Duality Seg Mod"
git status

Then commit:

git commit -m "Add all four segmentation model projects"
git push origin main

Option B: Using Command Prompt (CMD)

cd "C:\Users\YourUsername\Desktop\Duality Seg Mod"
git status

Then commit:

git commit -m "Add all four segmentation model projects"
git push origin main

Option C: Using Git Bash

cd "/c/Users/YourUsername/Desktop/Duality Seg Mod"
git status
git commit -m "Add all four segmentation model projects"
git push origin main

Troubleshooting for Windows:

  • If git not installed: Download Git for Windows
  • CRLF line ending issues:
    git config --global core.autocrlf true  # Windows users
  • SSH key issues: Generate with PuTTYgen or:
    ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
  • Cannot find file with spaces: Use quotes: cd "C:\path\with spaces\folder"

✅ Complete Verification Commands (All Platforms)

After pushing, verify everything was committed correctly:

# Check if all 4 projects are tracked
git ls-files | grep -E "^(DeeplabV3|OMEN|Duality)" | cut -d'/' -f1 | sort -u

# Check remote status
git remote -v

# View last commit
git log -1 --stat

# Count files per project
git ls-files | grep "^DeeplabV3plus + Resnet50" | wc -l
git ls-files | grep "^DeeplabV3plus+Efficientnet" | wc -l
git ls-files | grep "^Duality AI Seg Mod" | wc -l
git ls-files | grep "^OMEN" | wc -l

🛠️ Common Issues & Fixes

Issue 1: "Updates were rejected because the tip of your branch is behind"

Solution:

# All platforms
git pull origin main
git push origin main

Issue 2: "Please configure the Git user which will be used"

Solution:

# All platforms
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Issue 3: "Permission denied (publickey)"

Solution:

# Generate SSH key
ssh-keygen -t rsa -b 4096

# On macOS/Linux - add to SSH agent
ssh-add ~/.ssh/id_rsa

# Then add ~/.ssh/id_rsa.pub contents to GitHub Settings > SSH Keys

Issue 4: Files still showing as "modified content"

Solution:

# Force add all changes
git add -A
git status

# Check if .gitignore is excluding files
cat .gitignore

📋 Pre-Commit Checklist

Before committing, verify:

  • All 4 projects are showing in git status
  • No model files (*.pth, *.pt) are being tracked (should use .gitignore)
  • Virtual environments are not committed
  • Credentials/API keys are not in code
  • .gitignore is properly configured

Current .gitignore excludes:

  • *.pth, *.pt (model files)
  • pycache, *.pyc
  • venv/, ENV/, env/
  • .vscode/, .idea/
  • .DS_Store (macOS)
  • Thumbs.db (Windows)

🚀 Final Commit Command

Execute this command on your platform to finalize:

# macOS/Linux/Windows (all the same)
git add -A
git commit -m "Add all four segmentation model projects: DeeplabV3+Resnet50, DeeplabV3+Efficientnet, Duality AI Seg Mod, and OMEN+Segformer"
git push origin main

📊 Project Structure Summary

Duality Seg Mod/  (Main repository)
├── DeeplabV3plus + Resnet50/       ✅ Project 1
├── DeeplabV3plus+Efficientnet/     ✅ Project 2
├── Duality AI Seg Mod/             ✅ Project 3
├── OMEN_Segformer + DeeplabV3plus + Efficientnet/  ✅ Project 4
├── README.md
├── .gitignore
└── .gitattributes

💾 After Successful Push

Visit your GitHub repository to verify:

  1. All 4 folders appear in the main branch
  2. Commit history shows your new commit
  3. Total file count matches local repository

Command to check local file counts:

git ls-files | wc -l

Last Updated: April 12, 2026