Git Command – Part 2
git config –global user.name “lalit”
git config –global user.enail “lalit.nailwal@ebix.com”
git config –list
git config –global core.editors emacs
git config –global core.editors vim
git config user.name
git config user.email
git status
git init
git add –a | git add –all | git add -A | git add .
git commit -m “Initial Commit”
git commit –amend (to edit last commit along with message)
git log
git log -p (log along with file diffrences)
git log -p -2 (last two log along with file diffrences)
git log –stat (summary of changes in commit)
git log –pretty=oneline
git log –pretty=short
git log –pretty=full
git log –pretty=format:”%h — %an”
git log –pretty=format:”%h — %ae”
git log –since=2.days
git log –since=2.weeks
git log –since=2.months
git log –since=2.years
q (to quit from git log)
git add first.txt
rm -rf .git
git clone https://gitlab.ebix.com/abc.git abc
pwd
ls
cd tensorflow/
touch .gitignore (error.log, *.log, dir/(all dir folder), /dir/(outer dir folder), static/dir (dir folder inside static)
Note: blank folder is already ignored by git
git diff (compare working directory with statging area)
git diff –staged (compage starging area with last commit)
git commit -a -m “direct commit without doing stage step” (but is is good for only tracked file, untracked file will remain as it is)
git rm third.txt (command to remove a file, and it goes directely for staging)
git mv first.txt first_renamed.txt (command to rename and add directly to staging)
git rm –cached db.accdb (command to ask git to untrack a file before being added to .gitignore if it is been tracked from begning (Moving and renamin 8:39 reference codewith harry))
git restore –staged first_renamed.txt (to unstage a staged file)
git checkout — first_renamed.txt (to undo the change)
git checkout -f (to undo all changes and reset to last commit)
git remote
git remote add origin https://gitlab.ebix.com/abc.git
git remote -v
git push -u origin master
git push origin bugfix:mybugfix (push local bugfix branch to cloud as mybugfix)
git push -d origin bugfix (delete bugfix branch at remote)
git config –global alias.st status (git st)
git alias –global unstage ‘restore –staged –‘ (git unstage)
git checkout -b develop
git branch (list all branches)
git branch -v (list all branch along with last commit details)
git branch –merged (already merged branches)
git branch –no-merged (not merged branches)
git branch -d develop (delete branch, gives error if it is not merged)
git branch -D develop (delete branch, without error even if it is not merged)
git merge development