DEV Community

Ahmed Khaled MOhamed
Ahmed Khaled MOhamed

Posted on • Edited on

4 2

My Git Hot Commands

1--git log --pretty=format: --name-only --author="aa-ahmed-aa" --since="2 days ago" | sort | uniq
display the files modified by specific Author users within the Since time period

2--git fetch origin
3--git reset --hard origin/master
fetch the remote origin and hard reset your current with the remote (reset everything like the remote)

4--git log -p --author=aa-ahmed-aa
get a very detailed information about the files edited by the Author with all the insertion and deletion files

5-- git commit -m "adding the images" *.jpg
this is adding commit message to images only (add files by name if you want)
and if you push them it will only push the commited files

6-- git stash to save you current working directory changes to a specific point if you want to reset to master without losing changes
git stash list to list all of your stashed points

7-- 'git clean -d -x -f ' to remove the untracked files
be careful when using this command because it will erase all the untracked files even if this files is still used in your project
*this list is daily updated.

8-- 'git merge --abort' to revert back from the merging status

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay