Skip to content

⚙️ A collection of very useful and little-known Git commands.

Notifications You must be signed in to change notification settings

daoodaba975/git.jafewoul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

Git Jafewoul ⚙️

A collection of very useful and little-known Git commands.

Version FR 👉🏽 here

Made-In-Senegal

Contribute 🤝🏽

Also want to add a command that you find useful ?
Feel free to fork the project to add your contribution ✨

Create and switch a branch (one line)

git checkout -b name_of_my_new_branch

Delete a branch present on the remote repo

git push origin --delete
# after
name_of_my_remote_branch

Update the local repository of a specific branch

git pull origin my_branch

Clone a specific branch

git clone -b name_of_my_remote_branch git_project_url

Edit last commit message

git commit --amend

Add (forgotten) files to last commit

git add my_file
# after
git commit --amend

Show all commit information (hash, messages, dates, author)

git log

Show information about a specific commit count

# replace N with the number of commits you want to display
git log -N

Displays a set of commits according to a date slice

# date in DD/MM/YYYY format
git log --since=date --until=date

Shows each commit by author (useful on group projects)

git shortlog

Displays a graphical repository browser

# it can be thought of as a GUI wrapper for git log command
gitk

Undo last commit (soft)

# only the commit is removed from Git, your files remain modified
git reset HEAD^

Undo before last commit

# only the commit is removed from Git, your files remain modified
git reset HEAD^^

Undo commits and lose all changes (hard)

# this will unconfirm all your work
git reset --hard HEAD^

Search for a specific word or phrase in the files of a Git repository

# to search for all occurrences of "hello"
git grep "hello"

fsck (File System Check) is used to verify the integrity of a Git repository

# detects and reports corrupted objects or broken links in the repository
git fsck

About

⚙️ A collection of very useful and little-known Git commands.

Topics

Resources

Stars

Watchers

Forks