Skip to content

Git Commands Discussed in the Tutorial

Ravi Pudi edited this page Jan 9, 2024 · 2 revisions

git clone <URL> Clones the Github Repository to your local machine.

git status To check the status of your git at any stage.

git remote -v To check the remote repositories configured with your git.

git add . Adds the entire directory in which you are currently to staging.

git add <filename> Adds just the file to staging.

git commit -m Commits the staged changes to your repository with a message for easier reference later.

git log Shows the git log

git push origin main To push your changes to the Github Repo.

git diff Runs a diff(difference) function on Git Data Sources. These data sources can be commits, branches, and more.

git restore To undo the staged changes

git branch To show the branches

git checkout -b <branch name> To create a new branch

git checkout <branch name> To switch to a particular branch

git branch -d <branch name> To delete the branch

git merge To take the independent lines of development created by Git branch and integrate them into a single branch

git fetch Downloads new information about the status of the repo.

git pull origin main Pulls new information locally from the remote(origin github) branch.

Clone this wiki locally