Git与Devops的使用记录

Microsoft Windows [Version 10.0.19042.804]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\Administrator>git
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone             Clone a repository into a new directory
   init              Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add               Add file contents to the index
   mv                Move or rename a file, a directory, or a symlink
   restore           Restore working tree files
   rm                Remove files from the working tree and from the index
   sparse-checkout   Initialize and modify the sparse-checkout

examine the history and state (see also: git help revisions)
   bisect            Use binary search to find the commit that introduced a bug
   diff              Show changes between commits, commit and working tree, etc
   grep              Print lines matching a pattern
   log               Show commit logs
   show              Show various types of objects
   status            Show the working tree status

grow, mark and tweak your common history
   branch            List, create, or delete branches
   commit            Record changes to the repository
   merge             Join two or more development histories together
   rebase            Reapply commits on top of another base tip
   reset             Reset current HEAD to the specified state
   switch            Switch branches
   tag               Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch             Download objects and refs from another repository
   pull              Fetch from and integrate with another repository or a local branch
   push              Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.

C:\Users\Administrator>cd C:\GitRepo\Zhen_Branch

C:\GitRepo\Zhen_Branch>git clone https://ni.visualstudio.com/DefaultCollection/Global%20Services/_git/Vanchip
Cloning into 'Vanchip'...
remote: Azure Repos
remote: Found 7872 objects to send. (216 ms)
Receiving objects: 100% (7872/7872), 500.38 MiB | 2.46 MiB/s, done.
Resolving deltas: 100% (3457/3457), done.
Updating files: 100% (2095/2095), done.

C:\GitRepo\Zhen_Branch>cd Vanchip

C:\GitRepo\Zhen_Branch\Vanchip>git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

C:\GitRepo\Zhen_Branch\Vanchip>git checkout -b Zhen/KGU
Switched to a new branch 'Zhen/KGU'

C:\GitRepo\Zhen_Branch\Vanchip>git status
On branch Zhen/KGU
nothing to commit, working tree clean

C:\GitRepo\Zhen_Branch\Vanchip>git status
On branch Zhen/KGU
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   SemiOI/CompensationTool/Plugins/Config.ini
        modified:   SemiOI/CompensationTool/Plugins/Vanchip_compensation.lvlib
        modified:   SemiOI/CompensationTool/Plugins/Vanchip_compensation/Generate Display Data.vi
        modified:   SemiOI/CompensationTool/Plugins/Vanchip_compensation/Lot Begin.vi
        modified:   SemiOI/CompensationTool/Plugins/Vanchip_compensation/Lot End.vi
        modified:   SemiOI/CompensationTool/Plugins/Vanchip_compensation/Refresh Table.vi

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        SemiOI/CompensationTool/Plugins/Vanchip_compensation/Divide 1D Result into 2D Result.vi
        SemiOI/CompensationTool/Plugins/Vanchip_compensation/GU Info and Offset.ctl
        SemiOI/CompensationTool/Plugins/Vanchip_compensation/Read Site and KGU Configure File.vi

no changes added to commit (use "git add" and/or "git commit -a")

C:\GitRepo\Zhen_Branch\Vanchip>git add .
warning: LF will be replaced by CRLF in SemiOI/CompensationTool/Plugins/Config.ini.
The file will have its original line endings in your working directory

C:\GitRepo\Zhen_Branch\Vanchip>git commit -m "KGU compensation plugin Lot end update"

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'Administrator@DESKTOP-06L94UC.(none)')

C:\GitRepo\Zhen_Branch\Vanchip>git config --global user.email "zhen.yang@ni.com"

C:\GitRepo\Zhen_Branch\Vanchip>git config --global user.name "zhyang"

C:\GitRepo\Zhen_Branch\Vanchip>git commit -m "KGU compensation plugin Lot end update"
[Zhen/KGU 742b55d] KGU compensation plugin Lot end update
 8 files changed, 2 insertions(+)
 create mode 100644 SemiOI/CompensationTool/Plugins/Vanchip_compensation/Divide 1D Result into 2D Result.vi
 create mode 100644 SemiOI/CompensationTool/Plugins/Vanchip_compensation/GU Info and Offset.ctl
 rewrite SemiOI/CompensationTool/Plugins/Vanchip_compensation/Generate Display Data.vi (83%)
 rewrite SemiOI/CompensationTool/Plugins/Vanchip_compensation/Lot End.vi (78%)
 create mode 100644 SemiOI/CompensationTool/Plugins/Vanchip_compensation/Read Site and KGU Configure File.vi
 rewrite SemiOI/CompensationTool/Plugins/Vanchip_compensation/Refresh Table.vi (78%)

C:\GitRepo\Zhen_Branch\Vanchip>git status
On branch Zhen/KGU
nothing to commit, working tree clean

C:\GitRepo\Zhen_Branch\Vanchip>git push
fatal: The current branch Zhen/KGU has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin Zhen/KGU


C:\GitRepo\Zhen_Branch\Vanchip>git push --set-upstream origin Zhen/KGU
Enumerating objects: 24, done.
Counting objects: 100% (24/24), done.
Delta compression using up to 4 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 236.44 KiB | 4.93 MiB/s, done.
Total 14 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (14/14) (636 ms)
remote: Storing packfile... done (52 ms)
remote: Storing index... done (47 ms)
To https://ni.visualstudio.com/DefaultCollection/Global%20Services/_git/Vanchip
 * [new branch]      Zhen/KGU -> Zhen/KGU
Branch 'Zhen/KGU' set up to track remote branch 'Zhen/KGU' from 'origin'.

C:\GitRepo\Zhen_Branch\Vanchip>

当我们git clone完成之后,已经处在master下,最新的状态,只需要checkout -b “repo name” 来创建自己的分支;

做完修改后,git add . 来添加更改;git commit -m "说明"来提交更新;git push来push更新到自己的branch,在Devops上可以看到“Create a pull request" 提示,通过这个来merge master;或者左下角的Pull requests来创建merge请求,Reviewer填写项目负责人。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值