Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » gitignore and importing projects
gitignore and importing projects [message #1428749] Mon, 22 September 2014 09:20 Go to next message
Fredrik Berg is currently offline Fredrik BergFriend
Messages: 4
Registered: September 2014
Junior Member
Hello!

I've recently started using both git and EGit.
I've sucessfully created repositories for myself, and importing theese on different computers. Although I added the whole project to BitBucket, which I'm using as repo, and I've heard this is not optimal.
So i added a recommended gitignore for eclipse java project (pasted below, essentially only .java files) but now I can't import this project anymore.

I figured this had something to do with .project file so I added this to the repo, and it made me able to import the project BUT i still miss all liraries and such.

Am I supposed to remove some lines from the gitignore, or am I just doing something wrong when importing?

# Directories #
/build/
/bin/
target/
 
# OS Files #
.DS_Store
 
*.class
 
# Package Files #
*.jar
*.war
*.ear
*.db
 
######################
# Windows
######################
 
# Windows image file caches
Thumbs.db 
 
# Folder config file
Desktop.ini
 
######################
# OSX
######################
 
.DS_Store
.svn
 
# Thumbnails
._*
 
# Files that might appear on external disk
.Spotlight-V100
.Trashes
 
 
######################
# Eclipse
######################
 
*.pydevproject
.metadata
.project
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
/src/main/resources/rebel.xml
# External tool builders
.externalToolBuilders/
 
# Locally stored "Eclipse launch configurations"
*.launch
 
# CDT-specific
.cproject
 
# PDT-specific
.buildpath


Sorry about the english, not my first language Smile

Best Regards,

Fredrik
Re: gitignore and importing projects [message #1428883 is a reply to message #1428749] Mon, 22 September 2014 13:59 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
What do mean by "importing a repository" ?

.gitignore rules containing ** are not yet supported by jgit, should be fixed with https://git.eclipse.org/r/#/c/31366/ which is still under review

> Although I added the whole project to BitBucket, which I'm using as repo, and I've heard this is not optimal.

I don't get what you think is not optimal here
Re: gitignore and importing projects [message #1428896 is a reply to message #1428883] Mon, 22 September 2014 14:19 Go to previous messageGo to next message
Fredrik Berg is currently offline Fredrik BergFriend
Messages: 4
Registered: September 2014
Junior Member
By "Importing a repository" I'm talking about the funtion where you right-click in the package explorer and choose "Import" and the proceed to choose git.
This will if u have added a, say java, project to your repository create a local repository and a project in the workspace.

Well I'm not entirely sure myself since im still new to this Smile It's just that what I've seen most seem to advise against this.
I experienced som path problems with my java libraries when i did this, but im not sure if its related to me adding the entire project to the repository?

I hope this did not confuse you even more Smile

Best Regards,

Fredrik

Re: gitignore and importing projects [message #1428910 is a reply to message #1428749] Mon, 22 September 2014 14:39 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 22/09/2014 13:31, Fredrik Berg wrote:
> Hello!
>
> I've recently started using both git and EGit. I've sucessfully created
> repositories for myself, and importing theese on different computers.
> Although I added the whole project to BitBucket, which I'm using as
> repo, and I've heard this is not optimal.
> So i added a recommended gitignore for eclipse java project (pasted
> below, essentially only .java files) but now I can't import this project
> anymore.
>
> I figured this had something to do with .project file so I added this to
> the repo, and it made me able to import the project BUT i still miss all
> liraries and such.

It's ok to add the whole project. For .gitignore, I don't know who
"recommended" the file you pasted, but I'd tell you to just start with a
trivial .gitignore and add stuff over time to it. The simplest
..gitignore is maybe the one that EGit creates automatically, it only
adds bin/. Use that and you'll probably be fine.

Felix
Re: gitignore and importing projects [message #1428926 is a reply to message #1428910] Mon, 22 September 2014 14:50 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Which error do you get when you try to import / clone the repository ?
Also check the Eclipse error log for errors.
Re: gitignore and importing projects [message #1429405 is a reply to message #1428926] Tue, 23 September 2014 07:33 Go to previous message
Fredrik Berg is currently offline Fredrik BergFriend
Messages: 4
Registered: September 2014
Junior Member
Okay, thank you for the answers Smile
I think I'll go along with EGits own gitignore then.

I got the recommended file from GitHub (not enought posts to add link ;( )

I didnt get any errors, I simply wasnt able to press finish in the import procedure since there was no project in my repository (missing .project file).
Seems to be working well now when I only have bin/ in my gitignore Smile


Thanks again for the help!

Best Regards,

Fredrik
Previous Topic:Checking out commit
Next Topic:Changes made on branch appear on master.
Goto Forum:
  


Current Time: Thu Mar 28 16:38:57 GMT 2024

Powered by FUDForum. Page generated in 0.06963 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top