By Corey M Schafer link
git --versiongit configgit initgit statusgit ignoregit add -Agit resetgit commit -m “…”git loggit remote -vgit branch -a :lists local and remote branchesgit diffgit pull origin mastergit push origin mastergit branch: Also commit it to branch, so it wont reflect on mastergit branchgit checkoutgit mergegit branch -dgit push --delete origin
git checkout: undo recent uncommited changesgit commit --amend -m "": change message of the latest commit. But changes the git hstorygit commit --amend: incase u forgot to commit a file, doing this will add it to the latest commit. Do this only if you haven't pushed your changes to other people(because it changes the git history)git log --stat: Shows detailed logsgit cherry-picgit reset --soft: resets to specified commit but later files stay in stafing areagit reset: resets to specified commit but later files DONT stay in staging areagit reset --hard: removes later filesgit clean -df: cleans the staging areagit reflog: logs of what you've been doing. And u can restore using checkout and the hash shown. But hwne we do this, we'll be in a detached head state. so, we need to save these changes by creating another branchgit revert: This adds a new commit without changing the git history.
git stash save "message": saves changes and reverts the filegit stash list: lists all the stash messagesgit stash apply stash@{}: puts back the changes. But doesnt remove the stash's saved messagesgit checkout --.: undosgit stash pop: takes the recent stash and applies it and removes that saved stashgit stash drop stash@{}: removes the specified saved stashgit stash clear: removes all saved stashes
- diffmerge - A tool for viewing and merging with a GUI
git add -A: all in the git directorygit add -A: Adds files below this directorygit add: same as abovegit add --no-all: doesn't stage deleted filesgit add -u: doesn't add untracked filesgit add .: Adds files from current directorygit add *: wont be able to add hidden/deleted files as is* is a shell command