-1

the information it shows is something like

your local files will be override.......

Is something wrong with the gitignore file?
What can I do to eliminate it absolutely? Thanks a lot!

marlowex
  • 1
  • 2
  • Have you committed your local changes before pull? – Muhammad Azam Nov 24 '18 at 08:15
  • 1
    Commit, stash, or revert the changes you've done locally. – JB Nizet Nov 24 '18 at 08:15
  • I don't committed the files in the .idea dir because I want push it to the remote branch and these files is forbidden to push to the remote branch. – marlowex Nov 24 '18 at 08:26
  • Then use `.gitignore` to ignore the future tracking of .idea folder, and use `git filter-branch` to remove the history of .idea folder. – Geno Chen Nov 24 '18 at 08:42
  • Possible duplicate of [How do I resolve git saying "Commit your changes or stash them before you can merge"?](https://stackoverflow.com/questions/15745045/how-do-i-resolve-git-saying-commit-your-changes-or-stash-them-before-you-can-me) – phd Nov 24 '18 at 12:09
  • https://stackoverflow.com/search?q=%5Bgit-pull%5D+your+local+files+will+be+overwritten – phd Nov 24 '18 at 12:09

1 Answers1

1

It has nothing to do with the .gitignore it means that you have changes which are not committed while others have been modifying the same file in the remote repository.

Commit your changes and then perform the pull

# add your files to the staging area
git add . (or any other file that you need)

git commit

# now pull
git pull

Or if you dont wish to commit:

git stash 

# now pull
git pull

I don't committed the files in the .idea dir because I want to push it to the remote branch and these files is forbidden to push to the remote branch.

  • If you did not add those to the gitignore add them
  • If they are already commited remove them from the index

    # remve the commited files
    git rm --cached <file list>
    

Or if you wish to remove them completely from the history use

BFG - https://rtyley.github.io/bfg-repo-cleaner/

enter image description here

Use this ignore file from now on:

https://www.gitignore.io/api/intellij


CodeWizard
  • 128,036
  • 21
  • 144
  • 167