built-in git GUI
gitk
gitk
git remote -vgit remote showgit remote addgit fetchgit fetch --allgit pull | git pullgit pushgit pushgit push origin :old-name new-namegit push origin -u new-namegit branch -drgit push origin YourTagVersion
git reset --hard HEADgit reset --softgit checkout HEADgit revertgit reset --hardgit reset --hardgit reset --keep
git stash list
git mergegit rebasegit rebase --continuegit rebase --abortgit mergetoolgit add | git rm
git status
Changes files in your working directorygit diff
Changes to tracked filesgit diff <filename|filepath>
Show or list our the changes of specific file as per comparison to previous commitgit add . | git add ..
Add all current changes to the next commitgit add FILENAME
Add particular file changes to the next commitgit add -pgit commitgit commit -m 'Commit description'git commit -agit commit --amendgit commit --amend -m "an updated commit message"git commit --amend --no-edit
git init
Create a new local repository
The git init command creates a new Git repository. It can be used to convert an existing, unversioned project to a Git repository or initialize a new, empty repository. Most other Git commands are not available outside of an initialized repository, so this is usually the first command you’ll run in a new project.git clone <url>
Clone an existing repository
s a Git command line utility which is used to target an existing repository and create a clone, or copy of the target repository. In this page we’ll discuss extended configuration options and common use cases of git clone.
It can be used to:
– clone a local or remote repository
– clone a bare repository
– use shallow options to partially clone repositories
– git URL syntax and supported protocols
These commands work on /.git/config filegit config --system--unset credential.helpergit config --global--unset credential.helpergit config --global credential.helper wincredgit config --global credential.helper osxkeychain
To update your credentials, go to Control Panel → Credential Manager → Generic Credentials. Find the credentials related to your Git account and edit them to use the updated password.
Reference: How to update your Git credentials on Windows
Note that to use the Windows Credential Manager for Git you need to configure the credential helper like so:
git config --global credential.helper wincred
If you have multiple GitHub accounts that you use for different repositories, then you should configure credentials to use the full repository path (rather than just the domain, which is the default):
git config --global credential.useHttpPath true
The only thing that worked for me was navigating to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and removing the passwd file.
Once this file is removed, restart SourceTree and execute a fetch or something else that requires access to the repo in question. SourceTree will then prompt you for your password, rewriting the cached credentials.
I hope this helps. Shoutout to my buddy Nick for the assist.
If you’re a macOS user, Auke states below that “you can find the password files per repo it in ~/Library/Application Support/SourceTree”
git loggit log -pgit blamegit log --online --graph --decorate
git branchgit branch -avgit checkoutgit checkout -bgit checkout -b destination-BranchName sourceBranchName
How to keep a feature branch in sync with it’s parent branch
git checkout develop
git pull
git checkout feature/foo
git merge develop
git push
orgit checkout feature/foo
git pull --all
git rebase develop