Zum Inhalt

Commonly used commands

Git

Command action
git status Shows the actual status of the local files and differences in the local Git repositories
git init Creates a new Git repository with the basic configuration data in .git
git clone <SSH or HTTPS url> Clones or read a complete repository from the Git server
git diff displays the current differences in the current local repository. It shows only files which are changed and not already added using git add.
git checkout <hash or branch> Check-out the given branch or hash into the local directory.
git add <file or directories> Add a file to be added to the current branch and will be included in the check-in command below.
git ci -m "<commit message>" Check-in the added files to the current branch
git pull origin Synchronize the last changes from remote origin remote server to the local Git configuration
git push origin main Upload the last changes of the actual branches to the remote Git server

Docker

Each Docker container creates log or temporary files. These files are kept until the Docker container is removed. If the Docker container is stopped they still exists. A additional option --rm during startup will delete the container automatically after stop.

There can be a lot space usage if this log data and temporary files is not removed. It depends on the Docker image creator how this temporary data is handled.

Command action
docker pull <image url> Load an image from Docker hub in the internet
docker images List all local Docker images
docker rmi <image name oder hash > Remove a Docker image of the local images
docker ps List the local process list of running Docker container, the option -a show the local stopped Docker container
docker run -it <image name> Start the Docker image to an Docker container
docker run -it <image name> <commando> Start the Docker image to an Docker container but use the correspond command
docker exec -it <image name> <commando> Start a command inside a already running Docker container
docker stop <hash or containername> Stop the current running Docker container with a hash or container name
docker start <hash or containername> Restart a already stopped Docker container
docker rm <hash or containername> Remove the stopped Docker container

Docker-compose

Command action
docker-compose pull All related docker images in the docker-composer configuration are pulled from Docker hub (pull)
docker-compose up -d The corresponding docker container defined in the docker-compose configuration will be started in background
docker-compose up The corresponding docker container defined in the docker-compose configuration will be started in without going in background
docker-compose down Stopps all docker container defined in the docker configuration
docker-compose logs Display all logs of the running docker container start in the docker-compose. Adding the -f option will tail all logs created

Podman

Command action
podman play kube <yaml file> Start the pod defined like the kubectl configuration in Kubernetes
podman pod ls Display a list of all pods defined
podman pod stop <pod name> Stop a specific pod
podman pod start <pod name> Re-start a specific pod
podman pod logs <pod name> Display the output of an specific pod (all Podman container output)