Tuesday, July 15, 2025

πŸš€ Upgrading My Java Spring Boot + React ToDo App: Initial Git Setup

 When upgrading a production-ready full-stack application, one of the most important things is not to break what's already working. In this blog post, I'll walk through how I set up a separate working directory for the project and connected it via Git to the original folder on the same machine. This strategy lets me build and test new features like email verification and profile management without affecting the stable app.


πŸ“ Step 1: Copying the Original Project Folder

To keep the original project (todo_app) untouched, I first created a copy of it. On Windows, using PowerShell is the easiest way to include all files — even hidden ones like .git:

Copy-Item -Recurse -Force "C:\todo_app" "C:\todo_app_dev"

This creates a complete working copy at:

C:\todo_app_dev

πŸ“ Tip: Avoid using xcopy in Command Prompt, since it often skips hidden system folders like .git.


πŸ—‚️ Step 2: Verifying Git Presence

After copying, I verified that Git was still tracking the new folder by running:

cd C:\todo_app_dev

git remote -v

Since we copied everything, including the .git folder, this should show something like:

origin  https://github.com/yourusername/todo_app.git (fetch)

origin  https://github.com/yourusername/todo_app.git (push)

If this fails with:

fatal: Not a git repository (or any of the parent directories): .git

It means the .git folder wasn’t copied — in that case, either recopy using PowerShell or manually initialize and link to the original (see below).


πŸ” Optional: Manually Re-link Git to Original Folder

If you copied the folder without .git, you can still track changes by initializing Git manually and pointing it to the original project folder:

cd C:\todo_app_dev

git init

git remote add original C:/todo_app/.git

This way, you can push changes from the dev folder back to the original when you're ready:

git add .

git commit -m "Initial updates: Email verification and profile API"

git push original main

✅ Final Check

Confirm the remote is set properly:

git remote -v

Expected output:

original  C:/todo_app/.git (fetch)

original  C:/todo_app/.git (push)

 

🧠 Why This Setup?

  • Keeps the production folder clean and untouched

  • Enables experimental or breaking changes in a safe environment

  • Git allows easy syncing of feature branches back to the main repo

No comments:

Post a Comment

🧠 Basic ReactJS Programming Language Tutorial: Getting Started with Modern Web Development

 ReactJS is one of the most popular JavaScript libraries for building modern, interactive user interfaces — especially for single-page appli...