git init

git add <filename1> <filename2>

git add .

git checkout -- <filename>

git checkout -- .

git status

git config --global user.name <username>

git config --global user.email <email>

git commit -m 'reason'

git log

git reset --hard HEAD^

git reset --hard <version>

git remote add origin <url>

git push -u origin <branch>

git pull

克隆项目到本地 git clone <url>

创建并切换到自己的分支 git branch allen,  git checkout allen 或 git checkout -b allen

在自己的分支上做开发然后实施版本控制 git add . git commit -m 'reason'

将自己的工作合并到master上  git checkout master git merge allen.

不使用fast-forward方式合并(git log中没有分支记录) git merge --no-ff allen -m 'reason'

图形化的方式查看到分支信息 git log --graph --pretty=oneline --abbrev-commit

相关文章:

  • 2022-02-23
  • 2022-02-10
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
猜你喜欢
  • 2021-09-23
  • 2021-08-21
  • 2021-09-18
  • 2021-06-01
  • 2021-06-11
  • 2021-10-19
相关资源
相似解决方案