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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:02:47+00:00 2026-05-29T20:02:47+00:00

I searched internet and SO but could not get solution to this issue. I

  • 0

I searched internet and SO but could not get solution to this issue.
I am using git. I have the code, which has a branch B1 on computer C1. On another computer C2, I cloned this branch and locally, made one more branch B2. B2 is not pushed to central repository.

B1 and B2 are quite same, except one file FILE1. So I added that file to .gitignore and committed in B2. Now whenever I do some coding in B1, I push it in central repository. To get these changes on computer C2, I do

git pull origin B1

while I am on branch B2. But this gives error message:

CONFLICT (content): Merge conflict in FILE1

I wanted to ask, if there is a better way of bringing changes made in B1 to B2 (without bringing FILE1) or how can I improve my current method. Thanks for help, as I am new to git.

  • 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-29T20:02:48+00:00Added an answer on May 29, 2026 at 8:02 pm

    I think you’re misunderstanding the purpose of .gitignore:

    A gitignore file specifies intentionally untracked files that git should ignore. Files already tracked by git are not affected.

    So if your file is already being tracked by Git (which it seems to be in your case), adding it to .gitignore changes nothing.

    When you get a merge conflict, it means that the file has changed both on your current working tree and where you’re merging from (in your case, the remote repository). You **must* resolve any and all merge conflicts. There are lots of resources for how to resolve merge conflicts, the Git User Manual among them. You can also specify that Git use the local or remote copy to resolve conflicts:

    git pull -Xtheirs origin B1
    

    If you never meant to track the file, you can untrack it:

    git rm --cached myfilename
    

    As Greg mentions, if your intent is for the file to be a template configuration, name it as such, and then copy it and add the specialized version to .gitignore.

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

Sidebar

Related Questions

I have searched a lot but I could not find any good solution to
I have searched far and wide on the Internet but have not found anything
I searched a lot to get rid of this problem on the internet but
I never used progress bar. Searched in internet but could not find something useful.
I searched the whole internet but could not find any good explanation on how
This really puzzled for hours, I searched all over the internet, but got no
I have searched the internet for an answer to what could be causing EXCEPTION_ACCESS_VIOLATION
I'm trying to optimize my C++ code. I've searched the internet on using dynamically
i really need some help on this. I searched the internet but couldn't find
I've searched the internet for this but couldn't find anything useable, I was just

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.