Nikki Siapno
Nikki Siapno

@NikkiSiapno

12 Tweets 15 reads Jan 14, 2023
Getting stuck with Git sucks.
These 10 Git commands will save you from a lot of headaches:
git cherry -v master
Show all commits in the current branch that have not been merged into the main branch.
git branch -a
View all local and remote branches
git diff <commit-id-1> <commit-id-2>
View the differences between two commits.
git commit --amend -m 'Updated message'
Add changes to the last commit and update the commit message.
git clean -f -d
Remove all untracked files and folders
git stash branch <new-branch> stash@{0}
Create a new branch with your most recent stash
git show <branch>:<file>
View a file in another branch.
git revert <commit-id>
Revert all changes in a commit, use this if the changes have been pushed up to the remote branch.
git log --no-merges --raw --since='5 days ago'
View what has changed in the last 5 days.
git branch --merged master | grep -v "master" | xargs -n 1 git branch -d
Delete all local branches that have been merged into the main branch.
If you enjoyed this thread, don't forget to like, comment, and retweet the first tweet.
I simplify programming and getting into techπŸ’‘
Follow @NikkiSiapno for more threads like this.

Loading suggestions...