Skip to content

Latest commit

 

History

History
78 lines (36 loc) · 1.33 KB

BasicGitCommand.MD

File metadata and controls

78 lines (36 loc) · 1.33 KB

Git Commands Cheatsheet

Git Clone

Before cloning the repository ,you need to fork it first Creates a local copy of a remote repository.

git clone <repository_url>

Git Checkout -b <branch_name>

Creates a new branch and switches to it.

git checkout -b <branch_name>

Git Branch

Lists all branches in the repository.

git branch

Git Checkout <branch_name>

Switches to the specified branch.

git checkout <branch_name>

Git Status

Displays the current status of the working directory.

git status

Git Add

Stages a specific file for the next commit.

git add <filename>

Git Add .

Stages all modified files in the working directory for the next commit.

git add .

Git Commit -m <commit_message>

Records changes to the repository with a commit message.

git commit -m "<commit_message>"

Git Push --set-upstream

Pushes the local branch to the remote repository and sets the upstream branch.

git push --set-upstream origin <branch>

Git Log

Displays a log of commits.

git log

Some resources to learn about git and git commands

Complete Git and GitHub Tutorial
Common git commands
Complete Git and Github Course