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 8840753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:32:15+00:00 2026-06-14T10:32:15+00:00

I am new to GIT and have a question that may be stupid but

  • 0

I am new to GIT and have a question that may be stupid but from so far I searched there is no post mentioning this. Here is the situation:

                A                A'
upstream/master-+---+----+----+-----+
                    |
myworkingbranch     +---+---+---
                    A   B   C 

I fork a repo at point A, then make my own commit B, C,… at the same time, the original repo makes its commit A’. Generally, by applying git rebase, I can make B, C, … based on A’ instead on A.
However, In commit B, I have some files deleted, which remain in A’. Then, every time I excute git rebase, it complains the conflicts on deleted/removed files, which means I need to solve the conflict manually by mergetool or sth else.

I get from the github’s help page that it seems the question is divided to two parts:

  1. by git rebase, commits B,C would be canceled and myworkingbranch would go back to A in the cache. During this, how about the files that deleted in B? Will they be restored? I think not because if it will then there would be no problem.

  2. if the deleted files is not restored, when I apply commit A’ from upstream/master, which contains changing to the deleted files, there are conflicts. And every time rebasing, the conflicts need to be solved manually. Since there could be hundreds of such files, it is awful.

Qestion: While an upstream/master’s commit that contains changing to the files which is deleted in myworking branchis is applied, is there an elegant way of git rebase, that can Automatically omit the changes refering to those deleted files? in both the two parts of the problem I mentioned above?

I did find that for git merge, I can use .gitattribute file to omit certain files in the upstream branch. Will it work for git rebase? I guess it would not because, if I add those .gitattribute files via a commit, say, D in myworkingbranch, then when git rebase, status A would be in cache, not D, which again contains no .gitattribute files and conflict would occur during patching on A’

Thanks in advance for the help.

  • 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-14T10:32:17+00:00Added an answer on June 14, 2026 at 10:32 am

    You could activate git rerere, and memorize the conflict resolution once.

    The subsequent rebase wouldn’t be stopped by the same conflicts.


    During this, how about the files that deleted in B? Will they be restored? I think not because if it will then there would be no problem.

    Yes, a rebase starts by a checkout of the new base (A'): the files are restored in the index.
    And then it applies B and C.

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

Sidebar

Related Questions

We have a new git repo that is acrued from a svn repo. The
This may not be a git specific question, but it comes up in the
This is probably a dumb question, but I'm brand new to git and am
This is mostly a git settings question. I have a piwik installation in-place that
Totally new to Capistrano. I have a local git repository that I want to
I use git-new-workdir to have two working trees for one git repository. This usually
I'm new to git so forgive me if this is a dumb question. I
I have a question that's similar to How to undo 'git add' before commit?
I am new to Git and I seem to have one branch too many
I am very new to git. I have a .gitignore in the my working

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.