Closed armin-reichert closed 1 year ago
im not that trusted with Git and Github so what should I ignore when pushing?
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
erstmal danke für die hilfe allerdings hab ich ein problem da push to origin bei mir eine fehler meldung auswirft.
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.
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.
hat funktioniert danke.
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: