Git Repo & Local Main branch: Need to Reconcile

Today I edited my .gitignore to exclude public/videos/ because I don't need those saved in my project's repo, which it had been doing. I then went to my github.com repo and deleted the public/videos folder, created a pull request, and committed the change to main using my account tools on github.com.

Back in Wappler now, I refreshed the git Manager and saw the following:

The main branch at the top is Wappler's local branch which is just the .gitignore change which I committed locally. The "github...mvp/main" branch is the one at github.com.

My desired outcome is to merge the two main branches but that's not an option right-clicking on either branch name. I also don't want my local public/videos folder to be deleted since it no longer exists in the remote repo. Suggestions?

If it's in .gitignore it'll be ignored, meaning it won't be deleted, this can be seen in the staging area - the files don't appear in the staging area because they're ignored

I use:

In trying to "reset to this commit" in Wappler (the green branch in my previous pic), there was an attempt to delete my local public/videos/ folder.

So the remote branch is trying to delete my local videos folder.

Using github desktop, I fetched origin, then in Wappler I was able to merge the branches and then 'push to remote' so both repos were in sync.

Things are closer to being sane again, but oddly, in Wappler's git manager, it now wants to commit all the testing videos in public/videos that are now missing (intentionally) from my remote repo. I checked my local .gitignore and it still has 'public/videos/'

Seeing those 31 files and avoiding them in future commits is going to get annoying

If the files were already tracked by Git, adding them to .gitignore won’t stop Git from tracking them. You need to explicitly remove them from tracking. You can do this with the following commands:

git rm -r --cached public/videos/
git commit -m "Stop tracking public/videos/ and ignore it"

This worked:

git rm -r --cached public/videos/

but then this failed:

git commit -m "Remove videos from development"

It resulted in the following message:

On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   .gitignore

no changes added to commit (use "git add" and/or "git commit -a")

ChatGPT then suggested:

git restore --staged public/videos/

Which resulted in the message:

error: pathspec 'public/videos/' did not match any file(s) known to git

It's never easy. :slight_smile: However, I restarted Wappler to see if the videos were still staged and they have disappeared. Can I go home now?