git 常用命令

Posted weiweifeng

tags:

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

  • git config --list
    •   List all the settings git can find at /etc/gitconfig, ~/.gitconfig, ~/.config/git/config or .git/config.
  • git config --system --list
    • List the settings git can find at /etc/gitconfig.git config --global --list List the settings git can find at ~/.gitconfig or ~/.config/git/config.
  • git config --local
    •   --list List the settings git can find at .git/config.

 

  • git config --global http.sslverify false
    •   Set git value for current user.
  • git config --global user.name "Firstname Lastname"
    •   Set git value for current user.
  • git config --global user.email email@email.com
    •   Set git value for current user.
  • git clone git@github.com:xlhu/xxx.git
  • git checkout .
    •   Discard all changes
  • git push origin --delete hux10-ut-refactor2
    •   Delete remote branch
  • git branch -D branch
    •   Delete local branch
  • git push origin hux10-ut-refactor2
    •   Push local branch to remote
  • git checkout feature/ECDM-60686-rs-scope-out-changes-needed-to-remove-our-dependency-on-yavijava
  • git pull origin master
    •   从 master branch pull 改动到当前 branch
  • git reset --soft HEAD^
    •   Withdraw the commit and keep the changes

 

以上是关于git 常用命令的主要内容,如果未能解决你的问题,请参考以下文章

Git 中 6 个基本常用命令

git常用命令总结 git常用命令总结

Git常用命令

Git常用命令

git branch管理常用命令

Git常用命令收集