Question

I am downloading an eclipse project from source tree. The .project and .classpath files are not checked in. I want these checked in to do a successful import. I have no gitignore file. Can anyone shed some light as to why these files aren't coming across?

I also looked on the source machine that checked these files and the files are there. In the sourcetree version on that machine it doesn't show anymore files to be checked in.

My exlude file looks like this:
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
.DS_Store

This seems like this isn't the case either.

Thanks!

Was it helpful?

Solution 3

you can see what is not committed or staged yet with

git status

This should show that those files are not tracked yet. You can start to track them by adding them to the index:

git add .project

or add all files (not recommended if you don't have a proper .gitignore defined yet):

git add .

or

git add -A

if you want to stage deletions as well.

The other thing that could be happening here is that you are simply not seeing that the .project file is there. OSes usually hide these by default. Use

ls -A

to include these types of files in the directory listing. To see the contents of what git stored in the last commit, you can also use

git ls-tree HEAD

OTHER TIPS

Either your files have not been committed to the repository, as @adam-dymitruk told you, or you are ignoring them. Run this command:

$ git config --get core.excludesfile

And have a look at the file you get. You might have some patterns there which exclude your IDE files. I know that PHPStorm asks you at certain point to exclude theirs files globally. It might be that somebody (or eclipse) did the same in your source machine.

Apart from the repo-local .gitignore file, there might be further ignore options specified in the file .git/info/exclude in the repo, or using the config on a global level. You'll probably have to check for these things on the sender's machine, since that's where the files are and don't get checked in.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top