markdown Git命令备忘单

Posted

tags:

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

Create empty Git repo in specified directory. Run with no arguments
to initialize the current directory as a git repository.
```
git init <directory>
```

Clone repo located at <repo> onto local machine. Original repo can be
located on the local filesystem or on a remote machine via HTTP or SSH.
```
git clone <repo>
```

Define author name to be used for all commits in current repo. Devs
commonly use --global flag to set config options for current user.
```
git config user.name <name>
```

Stage all changes in <directory> for the next commit. Replace <directory> with a <file> to change a specific file.
```
git add <directory>
```

Commit the staged snapshot, but instead of launching a text editor, use <message> as the commit message.
```
git commit -m "<message>"
```

List which files are staged, unstaged, and untracked.
```
git status
```

Display the entire commit history using the default format. For customization see additional options.
```
git log
```

Show unstaged changes between your index and working directory
```
git diff
```

git delete remote tag
```
git push --delete origin tagname
```

git delete local tag 
```
git tag --delete tagname
```

git create tag
```
git tag -a vX.Y.Z -m "the message for tag"
```
Define the author name to be used for all commits by the current user
```
git config --global user.name <name>
```

Define the author email to be used for all commits by the current user.
```
git config --global user.email <email>
```

Create shortcut for a Git command. E.g. alias.glog log --graph --oneline will set git glog equivalent to git log --graph --oneline.
```
git config --global alias. <alias-name> <git-command>
```

Set text editor used by commands for all users on the machine. <editor> arg should be the command that launches the desired editor (e.g., vi).
```
git config --system core.editor <editor>
```

Open the global configuration file in a text editor for manual editing.
```
git config --global --edit
```

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

markdown git命令行备忘单

markdown MacOS命令备忘单

markdown PostgreSQL命令行备忘单

markdown Django命令备忘单

markdown Postgres SQL命令备忘单

markdown Django命令备忘单