简体   繁体   中英

Git how to ignore untracked CDT files

I'm working on a C++ project, after imported this project to eclipse, there are 3 new files/folders generated, they are:

.cproject

.project

.settings/

Not every one is using eclipse, so I'm not allowed to push this files to the repository, but I need them in order to work on eclipse, what should I do in such a situation when do the pushing.

I installed the EGit plugin for eclipse found here:

http://www.eclipse.org/egit/

In order to manage the hidden files in a C++ project I open the Navigator by selecting menu option:

Window -> Show View -> Navigator .

In the Navigator (on the left hand side) you can see all the files that are hidden from a C++ project (like .cproject ).

Select all the files/folders you need to ignore, right-click on the selection and go to popup menu item:

Team -> Ignore .

When you first ignore files in a folder a new file may appear (if its not already there) called .gitignore . You need to decide if the .gitignore file is going to be shared project-wide or not. If it is not currently being tracked and it needs to be you can add it to the index by right-clicking it and selecting Team -> Add to index . If it is not going to be tracked in the repository then you can select that file and ignore it.

Hope that helps.

You could add rules to the .gitignore file (and push that change by itself) so that they won't appear in git's list of working directory changes when you are ready to stage files for a commit.

Git Ignore Documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM