My Git Hot Commands

aaahmedaa profile image Ahmed Khaled MOhamed Updated on ・1 min read

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


Editor guide