Published: 12/4/2021. Updated: 12/30/2021
This post is mainly a personal reference for Git CLI commands, which I use more or less frequently. This will be living documentation, that will be updated from time to time.
I mainly work with the command line. For merge conflicts, diffs, and patch selections I prefer VS Code's UI.
git clone <project url> .
git remote set-url <remote_name> <remote_url>
git remote -v
Or edit via .git/config
file.
git pull origin <branch> --rebase
git config --global user.name "Someone"
git config --global user.email "someone@somewhere.com"
git config user.name "Someone"
git config user.email "someone@somewhere.com"
git checkout -b <branch>
Local
git branch -d <branch> # To see if there are unmerged changes
git branch -D <branch>
Remote
git push origin --delete <branch>
git checkout <branch>
git branch -m <new-branch-name>
git rebase -i HEAD~6
git push origin <branch> --force
Use the rebase
command and mark wanted commits by "e", which means that when doing the rebase it will stop for amending.
git rebase -i HEAD~6
git commit --amend
git rebase --continue
git commit --amend --date="now"
git commit --amend --author="Someone <someone@somewhere.com>"
git cherry-pick <commit-hash>
git stash -u
git stash list
git stash apply stash@{1}
git reflog --date=iso
Be the first commenter?
I am an experienced web developer with an eye for solid UI/UX design. I have specialized in front-end development, responsive web design, design systems, modern web frameworks, and content management systems. I also have experience in mobile apps development and back-end coding with PHP, Node.js, and Java. So I have a full stackish background, but I'm enjoying most building robust and beautiful front-ends with performance, accessibility, and testability in mind.
© Tero Auralinna
Auralinna.fiSunset with Bubbles: Travel and Photography Blog