Table of Contents generated with DocToc

  • Git notes
    • git ssh
    • SourceTree rolls back the version to a commit
    • Stash change
    • View all stores
    • Stash Restores storage changes
    • Add and reset
    • Discard changes
  • Discard all files
  • Remove is equivalent to deleting the file and doing git add XXX once
  • Git reset -q HEAD — XXX
  • Git checkout HEAD — XXX
  • Cancel the staging
  • discards

Git notes

git ssh

git config --global user.name "mrzou" git config --global user.email "[email protected]" ssh-keygen -t rsa -C SSH /id_rsa.pub # Copy the public key and paste it into your git repository Settings SSHCopy the code
  • windows

After the above steps, the window can be used normally

  • MAC OS Resources

    Ssh-add -k ~/. SSH /id_rsa # CD. SSH # CD Config file vi. Config # Enter the following configuration contents, Save the config file Host * UseKeychain yes AddKeysToAgent yes IdentityFile ~/. SSH /id_rsa IdentityFile ~/. SSH /github_rsaCopy the code

SourceTree rolls back the version to a commit

Stash change

git stash save tttggg
Copy the code

View all stores

$git stash list Stash @{0}: WIP on master: ee80f12 no message Stash @{1}: on master: # git stash apply stash@{0}Copy the code

Stash Restores storage changes

git stash apply stash@{0}
Copy the code

Add and reset

Git add xx/ XXX /fileName // cancel all temporary git resetCopy the code

Discard changes

Discarded files will go back to before git add

Git checkout note/git/SourceTree rollback the version to a commit.Copy the code

Remove the file

Git rm -q -f note/git/SourceTree rollback to a commit Git checkout HEAD -- XXX -- note/git/SourceTree rollback the version to a commit HEAD -- note/git/SourceTree rolls back the version to a commit. MdCopy the code

Merging branches

Git checkout is the branch to be merged. Git merge feat-order-list-20200820 Merge Git merge feat-order-list-20200820Copy the code