Rihpsalis / GhostGame

0 stars 0 forks source link

gitignore is empty #3

Closed armin-reichert closed 1 year ago

armin-reichert commented 1 year ago

As your .gitignore file is empty, also classes are pushed into the repository. When you create a Github repository, you can create an initial gitignore file which handles most files. A sample gitignore could have the following content:

/bin/
/target/
/.settings/

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/.classpath
/.project
Rihpsalis commented 1 year ago

im not that trusted with Git and Github so what should I ignore when pushing?

armin-reichert commented 1 year ago

Hallo,

das ist ja gerade die Aufgabe des .gitignore Files, dass es alle Inhalte, die nicht auf den Server übertragen werden sollen, herausfiltert. Du kannst dann einfach "Push to Origin" oder was immer ausführen und alle .class files, IDE settings etc. bleiben automatisch bei Dir lokal. Also füge einfach die oben gezeigten Zeilen in das leere .gitignore file ein und check es ein. Lösche auf dem Server den gesamten "out" Folder mit den .class Files.

Gruß Armin

Rihpsalis commented 1 year ago

erstmal danke für die hilfe allerdings hab ich ein problem da push to origin bei mir eine fehler meldung auswirft. image

image

18:45:25.303: [GhostGame] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/master:master error: failed to push some refs to 'https://github.com/Rihpsalis/GhostGame.git' hint: Updates were rejected because the tip of your current branch is behind To https://github.com/Rihpsalis/GhostGame.git hint: its remote counterpart. Integrate the remote changes (e.g. ! refs/heads/master:refs/heads/master [rejected] (non-fast-forward) hint: 'git pull ...') before pushing again. Done hint: See the 'Note about fast-forwards' in 'git push --help' for details.

armin-reichert commented 1 year ago

Hast Du auf GitHub Änderungen per Browser gemacht? Dann musst Du erst wieder einen "Pull" machen, bevor Du deine lokalen Änderungen aus in der IDE auf den Server überträgst ("Push"). Ich denke, das will die Meldung "Integrate the remote changes (e.g. ! refs/heads/master:refs/heads/master [rejected] (non-fast-forward) hint: 'git pull ...') before pushing again." Dir sagen.

Rihpsalis commented 1 year ago

hat funktioniert danke.