中文 English

Common Git Commands

Published: 2021-01-17
git clone svn stash commit reflog
  1. git reflog Display recent Git operation records
git reflog head@{0}
  1. git svn clone Check out from SVN repository to local Git repository
git svn clone -T trunk -b branch -t tags
  1. git svn dcommit Commit from local Git repository to SVN
git svn dcommit --rmdir
  1. git stash Save current changes to staging area (push to stack)
  2. git stash pop Retrieve the most recent saved changes from staging area (pop from stack)
  3. git gc --aggressive Compress Git repository with maximum compression
  4. git bundle create Package the entire Git project as a bundle file for easy transfer or long-term preservation
git bundle create GIT_BUNDLE_FILE --all
  1. git add Add files to commit git add *.* Add all new files to the commit git add -u Remove all deleted files from the commit
  2. git commit Commit history
git commit -m "Commit Log"