Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,284
Community Members
 
Community Events
176
Community Groups

[BUG]Sourcetree still need commit files which already ignored

Hi,

I’m ellan.

I have two file both  are add to repo ignore list. One .vcxprj file and another is .gitignore itself (through add it in file .git/info/exclude). Cause both  two files were  already tracking, I ran update-index –assume-unchanged <filepah>  in the bash. And the “File Status”  tab seems OK as Nothing to commit.

and there is output about git status

On branch master
Your branch is behind 'origin/master' by 72 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

nothing to commit, working tree clean

But when I tried to checkout a remote branch of this repo. A error comes up,

error: Your local changes to the following files would be overwritten by checkout:
 .gitignore
 VS_2012/DSO/DSO/DSO.vcxproj
Please commit your changes or stash them before you switch branches.

The Sourcetree version   2.4.8, Git 2.15.0.1, Win7 x64

1 answer

1 accepted

0 votes
Answer accepted
minnsey Atlassian Team Jun 27, 2018

Hi

I don't think you can do what you are trying to do in that way.

I'm assuming you want to effectively have Git forget about the vcxproj file and stop tracking it.

By adding it to the .gitignore you simply telling Git to ignore it from this point on, but other branches etc will still track it, hence the conflict when merging.


See here for some more suggestions:

https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore


see also https://www.git-scm.com/docs/git-update-index

Git will fail (gracefully) in case it needs to modify this file in the index e.g. when merging in a commit; thus, in case the assumed-untracked file is changed upstream, you will need to handle the situation manually. 

Thank you for the infomations very much.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events