Skip to content

Git

https://levelup.gitconnected.com/use-git-like-a-senior-engineer-ef6d741c898e

https://medium.com/mindorks/use-of-git-reset-git-revert-git-checkout-squash-commit-2b721ca2d2d3 https://teamtreehouse.com/community/difference-between-git-checkout-filename-and-git-revert https://git-scm.com/book/en/v2/Git-Basics-Undoing-Things

https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/Git-Branch-Create-Example-Command-Checkout-Commit-Tag

https://www.freecodecamp.org/news/git-diff-command/

Git = Push, Pull, Branching, Merging, conflict resolution. stash creating new branch rebase merge checkout swagg git switch fetch vs pull difference in git git squash git rebase

fast forward merge branch creation and usage in git

git fetch -all fetches all branches of all remotes git branch git branch -r = gives you all remote branches Git remote -v= Shows URLs of remote repositories when listing your current remote connections. git show --pretty="" --name-only 8a9cb100d34d65db367f1917aa3fe692c8ba94f5
git diff --cached = to show staged changes git show commit_id --name-only = to display all the files committed in the specified commit_id. 919836332632.0

git log https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History git log -p -2 = -2 to show only the last two entries. git log --stat

git log -p -- filename =

git reset = Undo git add for uncommitted changes with: git reset = To unstage all changes for all files:

git reset --hard HEAD (if you do not mind losing those minor changes)

git ammend - Git amend is a command in Git that allows you to make changes to the most recent commit in your repository without creating additional commits. It is particularly useful for editing commit messages, although you can also use it to add or remove files from the previous commit.

git show -- = = View specific file changes for a commit

git log : shows the commit history for the specified branch and any commits shared by it's parent branches

  • git config user.name "Christian Contribution Project
  • git config user.email "christian@personalemail.com
  • git config --list / git config user.name / git config user.email

Get Remote Repo URL

- git config --get remote.origin.url / git remote -v

merge conflict solving

- code below <<<<HEAD amd above ====== is already exists in your current head branch
- content below ====  and >>>> new branch is new upcoming code

diff two branches

- git diff branch1 branch2

SWITCH VS CHECKOUT DIFF

- git checkout is a multi-purpose tool, capable of switching branches, discarding changes, and even creating new branches
- git switch is more specialized, focusing solely on switching and creating branches.