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

  • Home
  • SEARCH
  • 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 7652159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:41:41+00:00 2026-05-31T11:41:41+00:00

Ok, so here’s the story. We’ve got git repository with 20-30k lines of code.

  • 0

Ok, so here’s the story. We’ve got git repository with 20-30k lines of code. My workmate copied (copied, not moved) few files in repo to create another module. Content of these files was just slightly modified. Then he made a commit. Meanwhile I worked with some of the files that he copied (the originals) and commited my work. When I was pulling I realized that I’ve got conflicts in files that I didn’t have, since he just created them (copied them). After resolving the conflicts I checked my local repo and I don’t have half of the files I suppose to have. I know git tracks the content of the files, not the file names, but right now it’s not very helpful.

git log remote_repo --stat --diff-filter=D

shows that few files was deleted, and

git log remote_repo --stat -C --diff-filter=D

shows that fewer files was deleted (but still some)

We need both copies of files so what should we do?

  • 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-05-31T11:41:42+00:00Added an answer on May 31, 2026 at 11:41 am

    You’ll need to rebase and try resolving the conflicts again. This may be simple or slightly more complex. If it is simple you will only nee to rebase the merge and fix the files that were deleted. Try this:

    git rebase -i HEAD~1
    

    You will be presented with a screen asking what you want to do to each commit.
    It will be something like:

    pick bb009b7 merge commit
    
    # Rebase 9775146..bb009b7 onto 9775146
    #
    # Commands:
    #  p, pick = use commit
    #  r, reword = use commit, but edit the commit message
    #  e, edit = use commit, but stop for amending
    #  s, squash = use commit, but meld into previous commit
    #  f, fixup = like "squash", but discard this commit's log message
    #
    # If you remove a line here THAT COMMIT WILL BE LOST.
    # However, if you remove everything, the rebase will be aborted.
    #
    

    Change pick to edit, save and quit the editor. You are now back in the merge commit. Run:

    git checkout <id of the previous commit> <filename>
    git commit --amend
    git rebase --continue
    

    That should fix it. If it doesn’t, you’ll need to go back further and it may be more complex.

    I would guess that it would go something like this:

    # rebase the last three commits, assuming:
    #  the oldest is your most recent changes
    #  the next is your co-worker's
    #  the last is the merge
    # You can probably go back only two but I generally
    # go back one extra just to see that things are as I 
    # expect.
    
    git rebase -i HEAD~3
    

    You will be presented with a screen asking what you want to do to each commit.
    It will be something like:

    pick 8d25cf0 Your changes
    pick e9ddd29 His changes
    pick bb009b7 merge
    
    # Rebase 9775146..bb009b7 onto 9775146
    #
    # Commands:
    #  p, pick = use commit
    #  r, reword = use commit, but edit the commit message
    #  e, edit = use commit, but stop for amending
    #  s, squash = use commit, but meld into previous commit
    #  f, fixup = like "squash", but discard this commit's log message
    #
    # If you remove a line here THAT COMMIT WILL BE LOST.
    # However, if you remove everything, the rebase will be aborted.
    #
    

    Leave the first line as is. Change pick in the second to edit. The last I think you want to edit as well.

    Write and save this and the rebase will begin. It will run through the first commit and stop at the second. Your files should be missing. You now want to run:

    git checkout <id of the previous commit> <filename>
    

    And that will restore files deleted by your coworker.

    Then run:

    git commit --amend
    git rebase --continue
    

    When you get to the merge commit just check to make sure that things are as you expect. If files are missing try checking them out again. Then amend and continue. You should now have everything you need.

    If you feel things are going wrong at any point

    git rebase --abort
    

    This will put you back to where you started and you can try again.

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

Sidebar

Related Questions

Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here's the scenario: I have a local git repository that mirrors the contents of
Here's my code: // Not all headers are relevant to the code snippet. #include
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
Here is the code in a function I'm trying to revise. This example works
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here is my SQL script CREATE TABLE tracks( track_id int NOT NULL AUTO_INCREMENT, account_id
Here is the final result of what my page is(not much fancy stuff yet):
Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
Here's some of my production code (I had to force line breaks): task =

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.