0% found this document useful (0 votes)
105 views4 pages

Essential Git Commands Cheat Sheat 2025

Jdjfjfkfnfnfkfnfnfajsbsbdbf

Uploaded by

jhyeokri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views4 pages

Essential Git Commands Cheat Sheat 2025

Jdjfjfkfnfnfkfnfnfajsbsbdbf

Uploaded by

jhyeokri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Essential Git Commands Cheat Sheet

git init: initializes a new Git repository.

git init projet_name

git clone: clones a repository from a remote source.

git clone https://exemple.com/depot.git

git add: adds files to the staging area.

git add

git commit: commits changes to the repository.

git commit -m “msg”

git status: shows the status of the repository.

git status

git push: pushes changes to a remote repository.

git push origin master

git pull: pulls changes from a remote repository.

git pull origin master

git branch: shows a list of branches in the repository.

git pull origin master

git checkout: switches to a different branch.

git checkout branch_name

git merge: merges changes from one branch into another.


git checkout branch_name

git log: shows a log of all the commits in the repository.

git checkout branch_name

git reset: resets the repository to a previous commit.

git reset --hard HEAD~1

git revert: undoes a previous commit.

git revert HEAD

git stash: temporarily saves changes that are not yet ready to be committed.

git stash

git tag: creates a new tag in the repository.

git tag v1.0.0

git remote: shows a list of remote repositories.

git remote -v

git fetch: fetches changes from a remote repository.

git fetch origin

git config: sets configuration options for Git.

git config --global user.name "your Name"

git diff: shows the differences between commits or branches.

git diff branch1..branch2


git blame: shows who made changes to each line of a file.

git blame file.txt

git grep: searches for text in the repository.

git grep "motif"

git show: used to display information about the commit with the ID. It shows the commit
message, author, date, and changes made in the commit.

git show abc123

git whatchanged: used to display the commit history along with the changes made in each
commit. It shows the commit message, author, date, and file changes.

git whatchanged

git cherry-pick: applies a specific commit to the current branch.

git cherry-pick abc12

git bisect: helps identify the commit that introduced a bug.

git bisect start

marwa jellali

You might also like