=> git config --global user.name "Bishworaj Poudel" => git config --global user.email "[email protected]"
git config --list
=> git help => git help
=> git init
=> git add filename => git add filename1 filename2 => git add . [To Add All Files In Directory]
=> git commit -m 'Short and Sweet Message' => git commit -am 'Staging and Comit Directly'
=> git clone <project_url>
=> git status => git status -s [Short Status]
=> git diff [ Find difference between commited and unstaged files ] => git diff --staged [difference in staged files]
=> git rm filename
=> git mv file_from file_to [If we rename the file]
=> git reset HEAD => git reset HEAD file1.txt
=> git checkout filename
=> git log => git log --oneline [Oneline Easy and Fast] => git log --stat [More History] => git log --pretty=oneline [Show SHA1 Value] => git log --pretty=format:"%h %s" --graph => git log --pretty=format:"%h - %an, %ar : %s" => git log --since=2.weeks => git log --after=2.weeks => git log --author "Bishworaj Poudel" => git log --oneline --decorate --graph --all
=> create .gitignore file => then add filename/foldername line by line => *.c => ignore al .c files => !main.c => not ignore main.c file => node_modules/ => Directory node_modules and all files inside it.
=> git restore => git restore --staged file1.txt
=> git remote show origin [To View Remote Origin Details] => git remote -v => git remote add origin : => git push origin master => git pull => pull data with current head => git fetch => only download the data to local repository => git fetch origin mod => To retrive remote branch => git remote rename pb paul => git remote remove paul => git push origin --delete bad-branch-name
=> git tag -l => git tag --list => git tag -a v1.4 -m "my version 1.4" => git show v1.4 => git tag v1.4-lw [Lightweigt] => git tag -d v1.4-lw => git checkout v2.0.0
=> git push origin .
=> git branch testing [To Creating Testing Branch] => git checkout testing [Switch Branch] => git commit -am 'made a change' => git checkout master [To Move to Master Branch] => git checkout -b .[Creating branch and switching to it] => git branch --merged => git branch --no-merged => git branch --move bad-branch-name corrected-branch-name
=> git reset => git reset SHA1 => git reset -hard SHA1
=> git stash save => git stash list => git stash pop => git stash apply stash{0} => git stash clear => git stash grop stash
git merge branchname git merge --no-ff branch name
Rebase