Here’s a collection of the most used git commands in my daily workflow as a developer in whatever project im coding

Git add

The first one is the “add” command to add the files and folders to a tracking state before we commits the changes

Bash
git add . 

Git commit

The next command i use before i can push my changes to my project repository is the commit command which simply makes a unique commit with all the tracked changed files and folders, its important that we apply an unique message to the commit for better overview later on

Bash
git commit -m "this is a unique commit message"

Git push

we use the -m flag with “” to define our commit message in your commit before the push step

The next command is the push command to pushing our committed changes to our project repository

we can push on one condition, that git has set a remote to the repository and is target the “main” or “master” branch in your git project

Bash
git push

# if first push u might set a upstream to the branch
git push --set-upstream origin {branch_name}|main/master

The –set-upstream flag set a connection between your local branch and the remote branch on the remote repository you can push to regularly with just “git push”

Git branch command

The “branch” command can show you all the branches created in your project, the way to see your list of branches u simply can do following

Bash
git branch