git命令

 

 

 

git checkout -- file把文件在工作区的修改全部撤销git reset <commit_id>回退到指定提交
git revert <commit_id>撤销指定的提交

查看配置文件:

git config --system --list(查看系统配置文件目录)

git config --global --list(查看全局配置文件目录)

设置用户信息配置

git config --global user.name "用户名"

git config --global user.email "邮箱"

 

 

Git命令拉取到推送完整流程

任务步骤:

 

 完成流程:

Harresion@DESKTOP-O6N9LRN MINGW64 /
$ cd e

Harresion@DESKTOP-O6N9LRN MINGW64 /e
$ cd GitSpace

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace (master)
$ cd my-app-git

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (master)
$ git checkout -b dev_zsy
Switched to a new branch 'dev_zsy'

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (dev_zsy)
$ git add -A

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (dev_zsy)
$ git add .

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (dev_zsy)
$ git status
On branch dev_zsy
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   src/App.js
        new file:   yarn.lock


Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (dev_zsy)
$ git commit -m "第一次提交"
[dev_zsy e0525ae] 第一次提交
 2 files changed, 8757 insertions(+), 1 deletion(-)
 create mode 100644 yarn.lock

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (dev_zsy)
$ git checout master
git: 'checout' is not a git command. See 'git --help'.

The most similar command is
        checkout

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (dev_zsy)
$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (master)
$ git merge dev_zsy
Updating 6914938..e0525ae
Fast-forward
 src/App.js |    2 +-
 yarn.lock  | 8756 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 8757 insertions(+), 1 deletion(-)
 create mode 100644 yarn.lock

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Harresion@DESKTOP-O6N9LRN MINGW64 /e/GitSpace/my-app-git (master)
$ git push origin master
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 4 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 152.03 KiB | 7.24 MiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.3]
To gitee.com:z12553608/my-app-git.git
   6914938..e0525ae  master -> master

  

  分支规范:

 

posted @ 2022-02-28 17:12  笨比不会Java  阅读(172)  评论(0)    收藏  举报