git creates and pushes a clean local new branch and the solution of Chinese garbled

1. Nagging background
  • The team has formulated branch management specifications. The current project is developed by a colleague alone, and there are only master and dev branches.
  • According to the branch specification, there should be a dev-${version}collaborative development branch and dev-${version}-${user}a personal development branch.
  • Therefore, you need to start with the dev branch and create the above two branches
2. Specific operation
  • View all branches, you are still on the master branch
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/dev
  remotes/origin/master
  • Create a new local dev branch from the remote dev branch
$ git checkout -b dev origin/dev
Switched to a new branch 'dev'
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
  • Create a new local dev-${version}branch and push to the remote
git checkout -b dev-1.0.0
git push origin dev-1.0.0:dev-1.0.0
  • Create a new local dev-${version}-${user}branch and push to the remote
git checkout -b dev-1.0.0-sunrise
git push origin dev-1.0.0-sunrise:dev-1.0.0-sunrise
3. git Chinese garbled
  • git commitWhen I found that the Chinese information after git was garbled, I scared myself away.
  • Actually, I didn't notice it. It was just git committhat the information displayed on the terminal was garbled, and after submitting to the remote branch and git logchecking the commit information, the Chinese was not garbled.
  • But I immediately Baidu, refer to the CSDN blog
git config --global i18n.commitencoding utf-8
git config --global gui.encoding utf-8 
git config --global i18n.logoutputencoding utf-8

Guess you like

Origin blog.csdn.net/u014454538/article/details/108625480