• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Questions about first Github commit - which files do I need to commit?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm adding my first bit of code to github.

I'm wondering which files I should commit. This is a web app I created from Gradle Web App

I am seeing this list of files:

.gitattributes
.gitignore
.gradle...cache.properties
.gradle...cache.properties.lock
.gradle...fileHashes.bin
.gradle...flisSnapshots.bin
.gradle...outpoutFileState.bin
.gradle...taskArtifacts.bin
----
build.gradle
*.java
web.xml

Do I need to commit any of the .*.prop or .*.bin files?

Thanks!
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric. You should not have to select the files every time you want to commit. You can use .gitignore to tell Git to ignore certain files by default.

Your .gitignore file can look something like this:

*
!/.gitattributes
!/.gitignore
!/build.gradle
!/README.md
!/src


This in essence says: "Ignore everything, except .gitattributes, .gitignore, build.gradle, README.md and the src folder".
This way Git won't ask you about any other files. This is also useful because it will prevent merging conflicts because your target keeps changing. Note that files that are already being tracked by Git will not be ignored, even if they're in the ignore list. To get rid of them, delete them from your local repository, commit the changes and make sure they are on the ignore list.
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic