Set your username and email address for Git commits. Note you need to run these only once if you pass the --global option, because Git will always use that information on that system. If you want to later override either of these with a different name or email address for a specific project, you can run the command without the --global option while in that project.
Create an empty git repo in a new directory named directory-name. Take care with the directory-name; it is typical to use a short, descriptive, name using only lowercase letters and the "-" character. Note that if you leave off the directory name then the current directory will be initialized as a git repository. For more detail see Git Guides: Git Init
Clone a repository from a repository in the cloud to your local system. Note that if you are planning to contribute to a project that is not yours, you will likely want to fork the repository into your own account first. For example, to contribute to a project hosted on GitHub, go to that repository and fork it into your own GitHub account. For more detail see Git Guides: Git Clone
Check the status to see if there are files that have been changed but not added (staged). This command will also list all staged changes. For more detail see Git Guides: Git Status
Download content from the remote repository and integrate these changes into the local repository. This command should be used regularly because without it your local branch wonβt have any of the updates that are present on the remote. For more detail see Git Guides: Git Pull
Here,>origin refers to the remote git repository from which the repo was cloned (note that this might be a fork). This command will set upstream of the the local branch of the remote respository on Github.
Here -u stands for set upstream. It is used to push a new branch named <branchname> by creating an upstream tracking branch that is related to your current local branch. For more detail see Git Guides: Git Push.
Delete the branch called <branch-name>. Note that you cannot be on the branch you are trying to delete. If you want to delete a branch that has not been merged, use -D instead of -d.
Oops, you forgot to update your branch and now the branch is dirty and canβt be merged. The git stash command saves the local modifications away and reverts the working directory to match the HEAD commit.
Provide a safer way to revert changes in the working tree or staging area. Itβs designed specifically for restoring files without switching branches or altering commit history.
Create a new commit that undoes changes from a specified commit. This can be seen as a way to "restore" the state of the repository to a prior condition, but through a new commit.
Remove untracked files from the working tree. Itβs similar in spirit to git restore in that it helps you bring your working directory to a clean state, but itβs focused on untracked files.