Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8094057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:40:19+00:00 2026-06-05T20:40:19+00:00

I have a folder with files and sub folder in it and I have

  • 0

I have a folder with files and sub folder in it and I have created a branch where I have been editing this folder and actually committed this (but not yet merged with the master).

However, I think I might have an issue if I do merge.

Assume my folder structure was like this:

Folder 
  - Sub-Folder A 
    - File A1
    - File A2
    - File A3
  - Sub-Folder B
    - File B1
    - File B2
    - File B3

And now I have edited to become:

Folder 
  - Sub-Folder A 
    - File A2 (Edited)
    - File A3
    - File A4
  - Sub-Folder C
    - File C1
    - File C2
    - File C3

I.E., File A1 deleted, File A2 edited, new File A4, Sub-Folder B and all contents deleted, a new Sub-Folder C.

I am concerned that the commit just seemed to have added the new and edited stuff and that the removed/deleted stuff will still be there when I merge.

Is this the case? How can I resolve if so?

I was thinking I should create a temp branch from master, git rm -f the folder, merge this back into master to remove the folder and then merge in the branch with the edits.

Is this a valid/workable approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:40:21+00:00Added an answer on June 5, 2026 at 8:40 pm

    You need to tell git about the files that you have removed. If you do a git status, it should list: A/A1, B/B1, B/B2, B/B3 as having been deleted. Having re-created your situation locally and then removed the files, git status gives:

    # On branch master
    # Changes to be committed:
    #   (use "git reset HEAD <file>..." to unstage)
    #
    #   new file:   A/A4
    #   new file:   C/C1
    #   new file:   C/C2
    #   new file:   C/C3
    #
    # Changes not staged for commit:
    #   (use "git add/rm <file>..." to update what will be committed)
    #   (use "git checkout -- <file>..." to discard changes in working directory)
    #
    #   deleted:    A/A1
    #   deleted:    B/B1
    #   deleted:    B/B2
    #   deleted:    B/B3
    

    If you do ‘git rm’ on each of A/A1, B/B1, B/B2 and B/B3 (despite the fact that the files no longer exists on disk) and commit those changes then it should all be fine.

    Does that help? Let me know if I need to clarify.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a folder with multiple sub-folders and each sub-folder contains 10-15 files. I
I have some folder with different files. I want to use something like this:
I have a web site http://www.mydomain.com Here I have created a sub folder http://www.mydomain.com/products
I have a sub-folder with two files. The first is email.php, with a form
I have a folder with two files: Awesome.File.20091031_123002.txt Awesome.File.Summary.20091031_123152.txt Additionally, a third-party app handles
I have a folder with multiple files, and I'd like to remove all <script>
I have a folder full of files and I want to search some string
I have a folder with 2000+ files. I want to count the files by
I have a folder of PHP files. The source code to these files is
I have a folder which contains few files and some directories which I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.