On the mid of 2020, I started learning and using git and it’s commands. Till now, I continued least 1 contribution to any of my public repo.
There are some commands that I frequently use.
Helps to clone a particular repository provided the repo-url into the specified <directory>.
Helps to view the status of the project or repo including staged, unstaged, and untracked files.
Helps to add a particular directory or files that have the changes.
git add .
Helps to add all the files in the currently directory that have the changes.
git commit -m ""
Helps to commit all staged changes. We can replace <message> with good commit messages so that everyone can understands what the change we have done.
git commit –amend
Helps to amend the commit messages if the commit is done only in the local repository and not been pushed.
We can type this command and press enter which then opens a text editor where we provide the new commit message.
Helps to push the local repository changes to the remote repository.
Helps to incorporates changes from a remote repository into the current branch. If the current branch is behind the remote, then by default it will fast-forward the current branch to match the remote.
Helps to start a new repository locally.
git remote add
Helps to add a new remote repository providing the <url>.