Skip to content

Git & Project Submission

← Home

S7 Inf A3 — Java for Graphical and Mobile Programming
Stéphane Derrode — Centrale Lyon

A concise reference for versioning your lab projects with Git and packaging them for Moodle. If you already use Git in another course, skip straight to the .gitignore and Submission sections.


Why Git (30 seconds)

Version control gives your code save points and a history: you can undo, compare versions, and never lose work. For the graded projects (BE1, BE2) done in pairs, it lets both partners contribute and merge their work.


Install

OS Command / link
Windows git-scm.com/download/win
macOS brew install git (or install the Xcode Command Line Tools)
Linux sudo apt install git

Verify, then set your identity (once per machine):

git --version
git config --global user.name  "Your Name"
git config --global user.email "you@example.com"

Core workflow

cd my-project
git init                       # start tracking this folder (once)

git add .                      # stage all changes
git commit -m "TD4: control panel works"

# ... keep coding ...
git status                     # what changed?
git add .
git commit -m "Add JComboBox fleet selector"

git log --oneline              # see your history

Commit small and often, with messages that say what you did.


.gitignore (important)

Never commit build artifacts — they are regenerated and bloat the repo. Create a .gitignore file at the project root.

target/
*.class
.vscode/
*.iml
.gradle/
/local.properties
.idea/
build/
app/build/

Android Studio offers to generate a complete .gitignore when you create the project — accept it.


Optional — a remote (GitHub / GitLab)

git remote add origin <repository-url>
git push -u origin main

Handy for pair work. Keep coursework repositories private and check the school's policy before pushing.


Submitting on Moodle

The graded projects (BE1, BE2) are submitted as a zip, not as a Git repository.

  1. Clean the build artifacts first (smaller archive, no compiled files):
    • Maven: mvn clean (removes target/)
    • Android: Build ▸ Clean Project
  2. Zip the project folder.
  3. Name it exactly:
    • BE1_NomPrenom1_NomPrenom2.zip
    • BE2_NomPrenom1_NomPrenom2.zip
  4. Put the PDF report inside the zip (see each project brief).
  5. Upload to Moodle before the deadline.

Tip: if you used Git, git archive -o BE1_Dupont_Martin.zip HEAD produces a clean zip of exactly the tracked files — no target/, no .git.