markdown Git - 有用的命令

Posted

tags:

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

# Git Commands

- Find Git Repository URL: `git config --get remote.origin.url`

- Check local status: `git status`

- Reset to latest branch head:

  Warning: This command will throw away all your uncommitted changes. For safety, you should always check that the output of `git status` is clean (that is, empty) before using it.
  
  `git reset --hard` 

- Open Git UI: `gitk` 

- Merge branch:
    - Fast-forward Merge Example:
      ```
      # Start a new feature
      git checkout -b new-feature master
      # Edit some files
      git add <file>
      git commit -m "Start a feature"
      # Edit some files
      git add <file>
      git commit -m "Finish a feature"
      # Merge in the new-feature branch
      git checkout master
      git merge new-feature
      git push origin master
      # Delete the branch
      git branch -d new-feature
      ```
    - Merge with commit: `git merge --no-ff <branch>`

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

markdown Git有用的命令

markdown Git - 有用的命令

markdown 有用的Git命令

markdown 有用的Git命令

markdown 有用的Git命令

markdown 有用的git命令