markdown Git Basics&Usefull命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Git Basics&Usefull命令相关的知识,希望对你有一定的参考价值。


# Branching strategies

- master
- dev
- feature
- next
- iss53
- iss53v2
- hotfix
- testing
- pu (proposed updates)

# Advanced commands

* ` git remote add origin <git-repo>.git`
* ` git pull `
* ` git pull origin master           # fetch and merge`

* ` git log --pretty=oneline`
* ` git log --graph --abbrev-commit --decorate --format=format:'%C(bold red)%h%C(reset) - %C(bold green)(%ar)%C(reset) <%an>%C(reset)%C(bold yellow)%d%C(reset) %C(white)%s%C(reset) %C(dim white)' --all`
* ` git log --graph --oneline --decorate --all`
* ` git reflog`

* ` git branch -av `
* ` git branch -d <branch-name>` or -D to --delete --force
* ` git branch --track <branch-name>`
* ` git checkout -b <branch-name> <commit-id-optional>`

* ` git config -l `
* ` git config --global user.name = "SERKAN BIRCAN"`
* ` git config --global user.email = serkanbircan21@outlook.com`
* ` git config --global alias.<alias> "<alias-command>"`

* ` git rm --cached <file>`

* ` git add .`
* ` git commit -a -m "commit message here"`
* ` git commit --amend`

* ` git diff`
* ` git diff HEAD`
* ` git diff <commit-hash>`
* ` git status -v -v`
* ` git diff --staged`


* ` git reset --hard`
* ` git reset --hard <commit-id>`
* ` git reset HEAD <file-name-to-unstage>`
* ` git checkout -- <file-name-to-discard-changes>`

* ` git revert <commit-id>`
* ` git revert HEAD~2..HEAD`
* ` git revert HEAD^..HEAD`

* ` git remote show origin`
* ` git remote rename origin paul`
* ` git remote rm paul`

* ` git push -u <remote-repo> <branch-name>`

* ` git merge <branch-name>`
* ` git rebase <branch-name>`

* ` git stash list`
* ` git stash show <stash>`
* ` git stash show -p <stash>`
* ` git stash <file-name>`
* ` git stash apply`
* ` git stash pop`

以上是关于markdown Git Basics&Usefull命令的主要内容,如果未能解决你的问题,请参考以下文章

markdown [Markdown basics] #tutorial

markdown `git add -A` vs`git add .` vs`git add -u`

markdown `git add -A` vs`git add .` vs`git add -u`

markdown JS.Basics.Objects.GetAllPropertiesOfAnObject

markdown JS.Basics.Loops.AdditionalParametersInIncrement

markdown Screeps Javascript Basics