These are common Git commands used in various situations:
start a working area (see also: git help tutorial) clone Clone a repository into a new directory init Create an empty Git repository or reinitialize an existing one
work on the current change (see also: git help everyday) add Add file contents to the index mv Move or rename a file, a directory, or a symlink reset Reset current HEAD to the specified state rm Remove files from the working tree and from the index
examine the history and state (see also: git help revisions) bisect Use binary search to find the commit that introduced a bug grep Print lines matching a pattern log Show commit logs show Show various types of objects status Show the working tree status
grow, mark and tweak your common history branch List, create, or delete branches checkout Switch branches or restore working tree files commit Record changes to the repository diff Show changes between commits, commit and working tree, etc merge Join two or more development histories together rebase Reapply commits on top of another base tip tag Create, list, delete or verify a tag object signed with GPG
collaborate (see also: git help workflows) fetch Download objects and refs from another repository pull Fetch from and integrate with another repository or a local branch push Update remote refs along with associated objects
'git help -a' and 'git help -g' list available subcommands and some concept guides. See 'git help <command>' or 'git help <concept>' to read about a specific subcommand or concept.
//Set a Git username $ git config --global user.name "VioletQQY"
//Confirm that you have set the Git username correctly: $ git config --global user.name > VioletQQY
//Set an email address in Git. You can use your GitHub-provided no-reply email address or any email address. $ git config --global user.email "forviolet771@gmail.com"
//Confirm that you have set the email address correctly in Git: $ git config --global user.email forviolet771@gmail.com
设置一个新的 SSH Key
Paste the text below, substituting in your GitHub email address.
This creates a new ssh key, using the provided email as a label.
1
Generating public/private rsa key pair.
When you’re prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location.
1
Enter a file inwhich to save the key (/Users/you/.ssh/id_rsa): [Press enter]
At the prompt, type a secure passphrase. For more information, see “Working with SSH key passphrases”.
1 2
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
将 SSH Key 添加到 ssh-agent
Start the ssh-agent in the background.
1 2
eval"$(ssh-agent -s)" Agent pid 59566
If you’re using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.
Add your SSH private key to the ssh-agent and store your passphrase in the keychain. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.
1
$ ssh-add -K ~/.ssh/id_rsa
将 SSH Key 添加到 GitHub
拷贝 SSH Key :
1 2
$ pbcopy < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
Using CATALINA_BASE: /usr/local/Cellar/tomcat/8.5.24/libexec Using CATALINA_HOME: /usr/local/Cellar/tomcat/8.5.24/libexec Using CATALINA_TMPDIR: /usr/local/Cellar/tomcat/8.5.24/libexec/temp Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home Using CLASSPATH: /usr/local/Cellar/tomcat/8.5.24/libexec/bin/bootstrap.jar:/usr/local/Cellar/tomcat/8.5.24/libexec/bin/tomcat-juli.jar Usage: catalina.sh ( commands ... ) commands: debug Start Catalina in a debugger debug -security Debug Catalina with a security manager jpda start Start Catalina under JPDA debugger run Start Catalina in the current window run -security Start in the current window with security manager start Start Catalina in a separate window start -security Start in a separate window with security manager stop Stop Catalina, waiting up to 5 seconds for the process to end stop n Stop Catalina, waiting up to n seconds for the process to end stop -force Stop Catalina, wait up to 5 seconds and then use kill -KILL if still running stop n -force Stop Catalina, wait up to n seconds and then use kill -KILL if still running configtest Run a basic syntax check on server.xml - check exit code for result version What version of tomcat are you running? Note: Waiting for the process to end and use of the -force option require that $CATALINA_PID is defined
MySQL
使用 Homebrew 安装 MySQL
1
brew install mysql
常用命令
We’ve installed your MySQL database without a root password. To secure it run:
1
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default. To connect run:
1
mysql -uroot
To have launchd start mysql now and restart at login:
1
brew services start mysql
Or, if you don’t want/need a background service you can just run: