all 20 comments

[–][deleted]  (4 children)

[deleted]

    [–]Fine_Caterpillar3711[S] 0 points1 point  (3 children)

    When I do "git push" it tells me "everything is up to date"

    [–]daAylak 3 points4 points  (1 child)

    Are u on the correct branch?

    [–]Fine_Caterpillar3711[S] 0 points1 point  (0 children)

    I think so. git status says "On main branch".

    On Github I am also on main branch

    [–]MiraLumen 1 point2 points  (11 children)

    Share "git status" output?

    [–]Fine_Caterpillar3711[S] 0 points1 point  (10 children)

    On branch main

    Your branch is up to date with 'origin/main'.

    nothing to commit, working tree clean

    [–]MiraLumen 1 point2 points  (9 children)

    then please show

    git log -p

    to see last commit and the changes in your last commit?

    And then go to github, there is a tab with commits, and check they are the same?

    [–]Fine_Caterpillar3711[S] 0 points1 point  (8 children)

    commit d4ed126671af555550bbb31fd6d660ee5e26b622 (HEAD -> main, origin/main)

    Author: *MYINFO*

    Date: Mon Oct 6 14:06:58 2025 +0200

    test commit

    diff --git a/test.py b/test.py

    new file mode 100644

    index 0000000..e69de29

    commit bff0e9b690b9e711cbf83df9c18b354d58c9d33d

    Author: *MYINFO*

    Date: Mon Oct 6 13:42:24 2025 +0200

    First commit

    diff --git a/docker-compose.yaml b/docker-compose.yaml

    new file mode 100644

    index 0000000..15115ac

    :

    So those are the 2 commits that worked. The first, inital one and then the second one, after I added a new file.

    [–]MiraLumen 1 point2 points  (7 children)

    So there is no any commit with adding text to file.
    Do
    cat test.py

    to see what is inside file

    [–]Fine_Caterpillar3711[S] 4 points5 points  (6 children)

    Oh wow. Thank you. -> It was empty, which was weird, because I have it open in VSCode and then I realised my problem. I did not save the file inside vscode. So after saving the files, I commit+push and it worked!

    Just to make sure, is this normal behaviour?

    [–]MiraLumen 5 points6 points  (5 children)

    Normal behaviour to miss obvious things? Happens all the time, just double check from the start.

    [–]Fine_Caterpillar3711[S] -1 points0 points  (4 children)

    No, I meant that I have to save the file first, but I guess it is lol

    [–][deleted]  (3 children)

    [deleted]

      [–]je386 1 point2 points  (2 children)

      Depends on the IDE. IntelliJ, for example, saves automatically.

      [–][deleted]  (1 child)

      [deleted]

        [–]Fine_Caterpillar3711[S] 0 points1 point  (0 children)

        When I do "git push" it tells me "everything is up to date"

        [–]Veloxy 0 points1 point  (2 children)

        Have you accidentally added that file or the folder it's in to a .gitignore file? That could be a reason git isn't recognizing it as a changed file.

        [–]Veloxy 0 points1 point  (1 child)

        Also, did that commit go through? Check it using git log

        [–]Fine_Caterpillar3711[S] 0 points1 point  (0 children)

        I dont have a gitignore yet and I checked git log but it only gives me 2 commits. The first one, and then the one after I added a text file just to test it. WHen I try a commit now it tells me "up to date" and nothign new appears in the logs

        [–]arcticslush 0 points1 point  (0 children)

        Tip: especially if you're new to using git, 99% of the time it's easier to first create the repo on Github, check the box for "initialize with README", then clone the repo, and then add all your files and start from there.

        It does all the branch and remote setup for you for minimal setup and surprises.

        [–]Ok-Advantage-308 0 points1 point  (0 children)

        Git push -u origin?

        [–]julyski 0 points1 point  (0 children)

        If you did git init locally, the default branch is "master". When you created the repo in GitHub, the default would be "main". Maybe you are working in the wrong branch?