�
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
cd /e/
mkdir gitSpace
cd /e/gitSpace/
git init
git add demo.txt
git commit -m "add a demo file"
git status
git diff demo.txt
git add demo.txtgit commit -m "changed demo.txt"
On branch master nothing to commit (working directory clean) git loggit log --pretty=oneline
git reset --hard HEAD^
git reset --hard ea3457
git reflog
git checkout -- demo.txt
git reset HEAD demo.txtgit checkout -- demo.txt
rm demo.txt
git rm demo.txtgit commit -m "remove demo.txt"
git checkout -- test.txt
ssh-keygen -t rsa -C "[email protected]"
git remote add origin [email protected]:username/demo.git
git push -u origin mastergit push origin master
git clone [email protected]:username/demo.git
git branch
git branch <name>
git checkout <name>
git checkout -b <name>
git merge <name>
git merge --no-ff -m "msg" <name>
git branch -d <name>
git log --graph --pretty=oneline --abbrev-commit
git stash
git stash list
git stash apply
git stash popgit stash drop
git branch -D <name>
git remote -v
git push origin branch-name
git pull
git branch --set-upstream branch-name origin/branch-name
git tag <tag-name> <commit id>
git tag -a <tagname> -m "blablabla..."
git tag -s <tagname> -m "blablabla..."
git tag
git push origin <tagname>
git push origin --tags
git tag -d <tagname>
git push origin :refs/tags/<tagname>
git branch |grep 'searchNameOrRegExp' |xargs git branch -D
git branch -r| awk -F '[/]' '/regExp/{printf"%s/%s\n",$2,$3}' |xargs -I{} git push origin :{}
forkin$(git branch -r | sed /\*/d);doif [ -z"$(git log -1 --since='4 week ago' -s $k)" ];then## Info about the branches before deleting branch_name_with_no_origin=$(echo $k| sed -e "s/origin\///")echo deleting branch: $branch_name_with_no_origin## Delete from the remote git push origin --delete $branch_name_with_no_origin;## Delete the local branch, regardless of whether it's been merged or not git branch -D $branch_name_with_no_originfi;donegit remote update origin --prune
touch .gitignore
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"