Very basic commands to use Git

in a repo hosted on a git-manager platform

-no, seriously, that's veeery basic and more of a self-reminder than a guide...

Basically because I've grown tired of looking around the whole web, to remember the correct procedure, every time I get my hands back into using git again after months or years that made me either forget or too insecure to go blindly (and make a mess with the little I've done so far).

Using the CLI (Command Line Interface) is better for me, as actions are limited on web-interfaces and otherwise it may be required to also install a GUI (Graphical User Interface) git-manager usually optimised for the repo's hosting platform.
So first, set Git on the machine meant to use it, following this link which I think might be the simpliest step-by-step procedure to install, set account and then set repo (Codeberg is the current example).
After this, just enter the local folder you've copied/synchronised the repo with, make the changes to files and directories as you like, then open the terminal on the starting (root) directory of this local clone of the repo (or open the terminal and change directory to its path with the cd command) -then run the following git commands

            
git add .
git commit -m "whatever message like: updating the repo"
git push
            
        

For good practice (don't run code you don't know in your terminal!), I should add below what each command does, both to remember and be sure what's needed each time or not:

  1. git add . ...
  2. git commit -m "whatever message like: updating the repo" ...
  3. git push ...

Also remember that each line is a different command, each must be run separately, so you can't just copy/paste the whole block but one at a time.
Unless, if I'm not wrong, using a "pipe" | symbol between each command on a single line -this should concatenate them one after the other.

So let's try like this:

            
git add . | git commit -m "updating the repo" | git push
            
        

...and no: it results in a fatal error as processes by git seem to run over each other like this.

Nonetheless, assuming a similar use of the Linux terminal, I successfully manage to concatenate the commands with the && instead of the |.
Just like this:

            
git add . && git commit -m "updating the repo" && git push
            
        

Once again the suggestion to not run stuff you don't know standed true, as I should have looked for meaning and uses of the two symbols (HERE I SHOULD LINK THEM), although I was ultimately lucky as git prevented the fatal error to break stuff.
So here is it: a blogpost of a person who was privileged enough to fail safely made for someone else (or a future me) to learn before this error!