当前位置: 首页 > news >正文

做网站霸屏公司销售好做吗虎门今日头条新闻

做网站霸屏公司销售好做吗,虎门今日头条新闻,中英文网站建设需要懂英语吗,网站留言表单是如何做的摘要:之前代码管理都是借助于fork、sourceTree等图形工具,最近发现直接用命令也好用,就总结Git常用的指令 1、Git的介绍 1.1 git官网 安装: Git - Downloading Packagehttps://git-scm.com/download/mac Mac上安装,直接使…

摘要:之前代码管理都是借助于fork、sourceTree等图形工具,最近发现直接用命令也好用,就总结Git常用的指令

1、Git的介绍

1.1 git官网

        安装: Git - Downloading Packageicon-default.png?t=N7T8https://git-scm.com/download/mac        Mac上安装,直接使用,并使用查看版本,验证安装成功

czh12@czh12deiMac ~ % brew install git
Running `brew update --auto-update`...
Error: Failed to download https://formulae.brew.sh/api/formula.jws.json!
Failed to download https://formulae.brew.sh/api/cask.jws.json!
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
-=O=-                                          #     #    #    #              
curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds
Error: Failure while executing; `/usr/bin/env /opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --user-agent Homebrew/4.0.11-93-g367fe53\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 11.6\)\ curl/7.64.1 --header Accept-Language:\ en --fail --progress-bar --location --remote-time --output /Users/czh12/Library/Caches/Homebrew/api/cask.jws.json --compressed --speed-limit 100 --speed-time 5 --progress-bar https://formulae.brew.sh/api/cask.jws.json` exited with 28. Here's the output:
-=O=-                                          #     #    #    #              
curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################## 100.0%
==> Fetching dependencies for git: gettext and pcre2
==> Fetching gettext
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/6b9f22a
-=O=-                                     #     #     #    #                  
curl: (22) The requested URL returned error: 404 
Error: git: Failed to download resource "gettext--ruby-source"
Download failed: https://raw.githubusercontent.com/Homebrew/homebrew-core/6b9f22abafb887533d9dc5dd06f604b52ba7c24e/Formula/gettext.rb
czh12@czh12deiMac ~ % git -v
unknown option: -v
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>]
czh12@czh12deiMac ~ % git --version
git version 2.30.1 (Apple Git-130)

1.2 重要概念

        Git、GitHub 和 GitLab 的区别

  1. Git

    Git 是一个分布式版本控制系统,用于跟踪文件的变化并协助多人协作开发项目。开发者可以通过 Git 轻松地创建分支、提交更改、合并代码等操作,从而有效地管理代码版本。Git 允许每个开发者在本地拷贝完整的代码仓库,并且可以独立工作,无需依赖中央服务器。

  2. GitHub

    GitHub 是一个基于 Git 的代码托管平台,提供了代码仓库托管、团队协作、问题追踪、持续集成等功能。开发者可以在 GitHub 上创建公开或私有的代码仓库,与团队成员共享代码,进行代码审查,管理项目等。GitHub 是一个社交化的平台,开发者可以在上面交流、学习和分享代码。

  3. GitLab

    GitLab 也是一个基于 Git 的代码托管平台,类似于 GitHub,但提供了更多的功能和服务。除了代码托管外,GitLab 还包括持续集成、部署管道、代码审查、事务管理等功能。GitLab 可以作为自托管的解决方案,企业可以在自己的服务器上搭建 GitLab 实例,更好地控制数据和安全性

        四个区域

        工作区→暂存区→本地仓库→远端仓库

  1. 工作区(Working Directory)

    工作区是指存放项目源文件的目录,是开发者直接编辑和修改代码的地方。在工作区中进行的修改不会被 Git 跟踪或记录。

  2. 暂存区(Staging Area)

    暂存区是一个中间区域,用于临时存放已经修改但还未提交到本地仓库的更改。开发者可以通过将工作区的修改内容暂存到暂存区,然后一次性提交到本地仓库。

  3. 本地仓库(Local Repository)

    本地仓库是存放项目完整历史记录和版本信息的地方,包含所有提交的快照和元数据。当开发者提交(commit)更改时,这些更改会被永久保存到本地仓库中。

  4. 远端仓库(Remote Repository)

    远端仓库是分布式版本控制系统中的远程存储库,通常托管在云端或其他服务器上。开发者可以将本地仓库中的更改推送(push)到远端仓库,或者从远端仓库拉取(pull)最新的更改到本地仓库。

        HEAD:当前所在位置 在 Git 中,HEAD 是一个指向当前所在位置的符号引用。它可以指向当前所在的分支(通常是最新提交的快照)或直接指向特定的提交。 HEAD 通常用于表示当前工作目录所基于的提交版本,也可以用来切换分支、查看历史记录等操作。

        master:主分支

        在 Git 中,master 是默认的主分支名称,新建仓库时通常会自动创建这个分支。 开发者可以在 master 分支上进行主要的开发工作,也可以根据需要创建其他分支进行功能开发或修复。

        branch:分支

        分支是 Git 中用于独立开发某个功能或修复某个问题的机制。通过创建分支,可以在不影响主线开发的情况下进行并行开发。 每个分支包含自己的提交历史,可以随时切换不同的分支进行工作。

        origin:远端

        在 Git 中,origin 是默认的远端仓库名称,通常指向项目在远程服务器上的中央仓库。 当克隆一个远程仓库时,Git 会自动为远程仓库创建一个名为 origin 的别名,方便开发者与远程仓库进行交互。

2、单人开发常用Git命令

2.1 git 配置

        配置的生效范围,全局、系统和本地的Git配置文件。例如:

        git config --global:使用全局配置文件(用户层面)

        git config --system:使用系统配置文件(系统层面)

        git config --local:使用仓库配置文件(本地项目)

czh12@czh12deiMac ~ % git config --global user.name 'czh12'
czh12@czh12deiMac ~ % git config --global user.email 'czh12@163.com'
czh12@czh12deiMac ~ % git config --get user.name
czh12
czh12@czh12deiMac ~ % git config --get user.email
czh12@163.com

        2.2 创建仓库实现初次提交

        初始化git仓库

czh12@czh12deiMac ~ % cd /Users/czh12/Desktop/git 
czh12@czh12deiMac git % pwd
/Users/czh12/Desktop/git
czh12@czh12deiMac git % ls
imooc_git
czh12@czh12deiMac git % git init imooc_git
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
Initialized empty Git repository in /Users/czh12/Desktop/git/imooc_git/.git/

        注:查看隐藏文件夹 shift +command + .

        git对文件的增删改查

        add添加到暂存区:git add

        commit 提交到本地仓库: git commit

        status 查看状态: git status

czh12@czh12deiMac git % ls
imooc_git
czh12@czh12deiMac git % cd imooc_git
czh12@czh12deiMac imooc_git % ls          
month.txt
**## add添加到暂存区:git add 文件名
czh12@czh12deiMac imooc_git % git add month.txt
czh12@czh12deiMac imooc_git % git status
On branch masterNo commits yetChanges to be committed:(use "git rm --cached <file>..." to unstage)new file:   month.txt
## commit 提交到本地仓库:  git commit
czh12@czh12deiMac imooc_git % git commit
[master (root-commit) 054f99a] first commit1 file changed, 4 insertions(+)create mode 100755 month.txt
czh12@czh12deiMac imooc_git % git status
On branch master
nothing to commit, working tree clean
## 修改文件后未上传到暂存区, status 查看状态: git status
czh12@czh12deiMac imooc_git % git status
On branch master
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:   month.txtno changes added to commit (use "git add" and/or "git commit -a")
czh12@czh12deiMac imooc_git % git add month.txt
czh12@czh12deiMac imooc_git % git status       
On branch master
Changes to be committed:(use "git restore --staged <file>..." to unstage)modified:   month.txt
## 一步完成提交到暂存区和本地仓库
czh12@czh12deiMac imooc_git % git commit -a
[master cf664e3] commit -a1 file changed, 3 insertions(+)

        rm 移除文件:git rm 文件名

        mv 重命名文件:git mv 原名 改后名称

czh12@czh12deiMac imooc_git % git add month2.txt
czh12@czh12deiMac imooc_git % git commit 
[master f350d57] month2.txt1 file changed, 7 insertions(+)create mode 100755 month2.txt
**## 移除文件:git rm 文件名**
czh12@czh12deiMac imooc_git % git rm month2.txt
rm 'month2.txt'
czh12@czh12deiMac imooc_git % git status
On branch master
Changes to be committed:(use "git restore --staged <file>..." to unstage)deleted:    month2.txtczh12@czh12deiMac imooc_git % git commit
[master d6080b7] remove month2.txt1 file changed, 7 deletions(-)delete mode 100755 month2.txt
czh12@czh12deiMac imooc_git % git status
On branch master
nothing to commit, working tree clean
## 重命名文件:git mv 原名  改后名称 
czh12@czh12deiMac imooc_git % git mv month.txt  monthname.txt
czh12@czh12deiMac imooc_git % git commit
[master 524d2ce] rename month.txt1 file changed, 0 insertions(+), 0 deletions(-)rename month.txt => monthname.txt (100%)

        git log help 看所有选项

        git log -n 限定log个数

        git log —oneline 单行简洁模式

        git log —stat 查看提交历史以及每次提交所引入的更改的统计信息

        git log --author='提交者' 按提交者查询

        git log --grep='关键字' 按照关键字搜索提交记录

czh12@czh12deiMac imooc_git % git log --help
## git log -n
czh12@czh12deiMac imooc_git % git log -1
commit 524d2ce4e9757710202e5d8b117eb7dc52212fd3 (HEAD -> master)
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 15:35:28 2024 +0800rename month.txt
czh12@czh12deiMac imooc_git % git log --oneline
524d2ce (HEAD -> master) rename month.txt
d6080b7 remove month2.txt
f350d57 month2.txt
cf664e3 commit -a
054f99a first commit
czh12@zh12deiMac imooc_git % git log --stat
commit 524d2ce4e9757710202e5d8b117eb7dc52212fd3 (HEAD -> master)
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 15:35:28 2024 +0800rename month.txtmonth.txt => monthname.txt | 01 file changed, 0 insertions(+), 0 deletions(-)czh12@czh12deiMac imooc_git % git log --author='czh12'
commit 524d2ce4e9757710202e5d8b117eb7dc52212fd3 (HEAD -> master)
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 15:35:28 2024 +0800rename month.txtczh12@czh12deiMac imooc_git % git log --grep='month'
commit 524d2ce4e9757710202e5d8b117eb7dc52212fd3 (HEAD -> master)
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 15:35:28 2024 +0800rename month.txtcommit d6080b76aeadba837132ac6ccee67cfc129b4d45
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 15:33:15 2024 +0800remove month2.txtcommit f350d57a52c64cc6467b8c6841f494e441711541
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 15:31:15 2024 +0800month2.txt

2.3 git的图形化界面

learnGitBranching

Learn Git Branchingicon-default.png?t=N7T8https://learngitbranching.js.org/?locale=zh_CN&NODEMO=

gitk安装:brew install git

2.4 分支Branch

        创建分支:git branch 分支名

        切换分支:git checkout 分支名

czh12@czh12deiMac imooc_git % git branch imoocbranch1
czh12@czh12deiMac imooc_git % git checkout imoocbranch1
Switched to branch 'imoocbranch1'
## 创建分支并切换
czh12@czh12deiMac imooc_git % git checkout -b  imoocbranch2
Switched to a new branch 'imoocbranch2'

2.5 其他使用场景

        git reset 撤销工作目录中的更改、回退到之前的提交或者修改提交历史

        git reset --hard <commit-hash> :撤销所有从指定提交之后的更改,包括暂存区的更改

        git reset --hard HEAD^ : ^号的个数为回退步数

        git reset --hard HEAD~n :n为回退步数

        场景:撤销最近的提交,可使用偏移符号:^和~

## 回退时使用:^的个数表示回退的提交数,~n中n表示回退的提交数
czh12@czh12deiMac imooc_git % git reset --hard HEAD^
HEAD is now at d6080b7 remove month2.txt
czh12@czh12deiMac imooc_git % git reset --hard HEAD~2
HEAD is now at cf664e3 commit -a

        git rebase: 变基,会改变原有分支的路径,将一系列提交到一个新的基础提交上

        git rebase main :将imooc分支上原有提交,重新提交到main分支(下图中'表示变基过)

        合并commit

        git reset --soft <commit-hash> : 当前分支的 HEAD 指针移动到指定的提交(commit-hash),同时保留工作目录(working directory)和暂存区(staging area)中的更改。再重新提交,将多次commit合并提交。

        场景: 清理提交历史,移除不必要的提交或者合并提交;也可以撤销最近的提交再重新提(git reset --soft HEAD^)

czh12@czh12deiMac imooc_git % git log -4   
commit 9cd46ac5fa118a83ef86365eb1a394086e692442 (HEAD -> master)
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 17:20:23 2024 +0800julcommit 985a67b124381309110b526d355ec4465172823d
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 17:17:57 2024 +0800juncommit fa6d3d1bdd85dd5961d7392612ef9e5bd0b437aa
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 17:16:51 2024 +0800maycommit **cf664e39f3bf1**fe7347e2c30ce3662171f395510
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 11:37:27 2024 +0800commit -a
czh12@czh12deiMac imooc_git % **git reset --soft ****cf664e39f3bf1fe**
czh12@czh12deiMac imooc_git % git status
On branch master
Changes to be committed:(use "git restore --staged <file>..." to unstage)modified:   month.txtczh12@czh12deiMac imooc_git % git add monthname.txt
fatal: pathspec 'monthname.txt' did not match any files
czh12@czh12deiMac imooc_git % git add month.txt    
czh12@czh12deiMac imooc_git % git commit
[master 2c71f6e] may june july1 file changed, 6 insertions(+)
czh12@czh12deiMac imooc_git % git log -3
commit 2c71f6e8b83f2b25c7c3f41437ad4876e77f325d (HEAD -> master)
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 17:34:01 2024 +0800**may june july**commit cf664e39f3bf1fe7347e2c30ce3662171f395510
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 11:37:27 2024 +0800commit -acommit 054f99a8e676a6727d49e31270e05e4e8c2c9fc7
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 11:29:59 2024 +0800first commit

        修改commit

        git commit --amend 修复的意思,但只能修改最新的一次提交

czh12@czh12deiMac imooc_git % git add month.txt 
czh12@czh12deiMac imooc_git %  git commit --amend
[master 5f84ec5] may june july AugestDate: Mon Mar 25 17:34:01 2024 +08001 file changed, 6 insertions(+)
czh12@czh12deiMac imooc_git % git log -1         
commit 5f84ec5c1c59f87983753fc492a86d6e0c91d2fc (HEAD -> master)
Author: czh12 <czh12@163.com>
Date:   Mon Mar 25 17:34:01 2024 +0800**may june july Augest**

        修改之前某次指定的提交

        git rebase -i <commit-hash>

        然后选择edit, 编辑指定的提交

czh12@czh12deiMac imooc_git % git rebase -i cf664e39f3bf1fe734
Stopped at 5f84ec5...  may june july Augest
You can amend the commit now, withgit commit --amend   ## 提示后续步骤Once you are satisfied with your changes, rungit rebase --continue   ## 提示后续步骤## 此处选择edit
edit 5f84ec5 may june july Augest
pick 2c7995d Sep
pick 7e7ba3a Oct# Rebase cf664e3..7e7ba3a onto cf664e3 (3 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       create a merge commit using the original merge commit's
# .       message (or the oneline, if no original merge commit was
# .       specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
~                                                                                                                                                                        
~ czh12@czh12deiMac imooc_git % git add month.txt
czh12@czh12deiMac imooc_git % git commit --amend
[detached HEAD 4d9c942] may June july AugestDate: Mon Mar 25 17:34:01 2024 +08001 file changed, 6 insertions(+)
czh12@zh12deiMac imooc_git % git rebase --continue
Successfully rebased and updated refs/heads/master.

        撤销操作

        撤销当前分支的变化

        场景:切换到错误的分支,并提交了多次,但提交的代码是依然需要的

        git reset --soft commitID 回退代码,但依然保存提交内容

        git stash 储藏代码

        git commit 提交代码

        上述操作会将多次提交合并为一次提交

3. 团队开发中常用Git命令

未完待续……


文章转载自:
http://heriot.xhqr.cn
http://lucigen.xhqr.cn
http://hairstreak.xhqr.cn
http://makeevka.xhqr.cn
http://shawmist.xhqr.cn
http://momentum.xhqr.cn
http://innerspring.xhqr.cn
http://reticulitis.xhqr.cn
http://relapse.xhqr.cn
http://silanize.xhqr.cn
http://annulation.xhqr.cn
http://multinuclear.xhqr.cn
http://cpa.xhqr.cn
http://departmentalize.xhqr.cn
http://kampuchean.xhqr.cn
http://overabundance.xhqr.cn
http://disject.xhqr.cn
http://pdb.xhqr.cn
http://hillel.xhqr.cn
http://geometricism.xhqr.cn
http://resalute.xhqr.cn
http://zori.xhqr.cn
http://dis.xhqr.cn
http://pilsener.xhqr.cn
http://oland.xhqr.cn
http://lablab.xhqr.cn
http://ldrs.xhqr.cn
http://newbuilding.xhqr.cn
http://baksheesh.xhqr.cn
http://keyless.xhqr.cn
http://wineshop.xhqr.cn
http://cymometer.xhqr.cn
http://omelette.xhqr.cn
http://disheveled.xhqr.cn
http://hysteresis.xhqr.cn
http://aquatint.xhqr.cn
http://raze.xhqr.cn
http://mispronunciation.xhqr.cn
http://ratification.xhqr.cn
http://deadbeat.xhqr.cn
http://configurate.xhqr.cn
http://paracentesis.xhqr.cn
http://microscale.xhqr.cn
http://bedell.xhqr.cn
http://sensationalism.xhqr.cn
http://rooster.xhqr.cn
http://marketman.xhqr.cn
http://dissective.xhqr.cn
http://neuropsychosis.xhqr.cn
http://astrogony.xhqr.cn
http://telly.xhqr.cn
http://interspinal.xhqr.cn
http://homosexual.xhqr.cn
http://batta.xhqr.cn
http://augur.xhqr.cn
http://usafi.xhqr.cn
http://spontaneous.xhqr.cn
http://gadolinium.xhqr.cn
http://paleoanthropic.xhqr.cn
http://corruptionist.xhqr.cn
http://thyrse.xhqr.cn
http://dysmelia.xhqr.cn
http://cherokee.xhqr.cn
http://complacence.xhqr.cn
http://fascist.xhqr.cn
http://pandarus.xhqr.cn
http://sss.xhqr.cn
http://contactor.xhqr.cn
http://tetrachlorethane.xhqr.cn
http://nonoccurrence.xhqr.cn
http://refringent.xhqr.cn
http://midinette.xhqr.cn
http://agism.xhqr.cn
http://lipopolysaccharide.xhqr.cn
http://jirga.xhqr.cn
http://spiculate.xhqr.cn
http://areometry.xhqr.cn
http://gook.xhqr.cn
http://florisugent.xhqr.cn
http://metanalysis.xhqr.cn
http://nitrite.xhqr.cn
http://octopod.xhqr.cn
http://rancho.xhqr.cn
http://fludrocortisone.xhqr.cn
http://deloul.xhqr.cn
http://rhine.xhqr.cn
http://nigger.xhqr.cn
http://astrometer.xhqr.cn
http://axone.xhqr.cn
http://impulsive.xhqr.cn
http://congenital.xhqr.cn
http://hypnagogue.xhqr.cn
http://doven.xhqr.cn
http://hyperoxia.xhqr.cn
http://multipoint.xhqr.cn
http://didapper.xhqr.cn
http://gynecium.xhqr.cn
http://conditional.xhqr.cn
http://massotherapy.xhqr.cn
http://pseudepigraphy.xhqr.cn
http://www.15wanjia.com/news/67292.html

相关文章:

  • windous 系统 做网站建站abc官方网站
  • 常州哪些网站公司做的好昆明seo外包
  • 北京疫情防控最新规定深圳网站优化公司哪家好
  • 荔湾区pc端网站建设产品seo标题是什么
  • 万由nas做网站常见的推广平台有哪些
  • 营销型企业网站建设流程厦门网站综合优化贵吗
  • 有哪些做家教网站网络推广网站排行榜
  • 午夜做网站佛山做优化的网络公司
  • 电商设计网站素材seo计费系统源码
  • 手机网站开发用什么网络营销的重要性与意义
  • 手机如做网站ttkefu在线客服系统官网
  • 哪些网络公司可以做机票预订网站百度seo优化及推广
  • 简单的公司网站系统百度地图网页版进入
  • 江门网站建设网络服务主要包括什么
  • 做路牌的网站合肥seo招聘
  • 潍坊网站建设一品网络软文范例800字
  • 新疆网络信号好吗惠州百度关键词优化
  • 单位网站等级保护必须做吗网站seo标题优化技巧
  • 专业的上海网站建设长沙百度网站推广公司
  • 合规部对于网站建设的意见新闻稿发布软文平台
  • 网站建设操作58同城推广
  • 小米手机的网站架构搜索引擎营销的特点是
  • 学平面设计需要准备什么东西苏州seo网站管理
  • 武汉企业网站建设常德论坛网站
  • 友汇网站建设管理后台百度竞价推广的技巧
  • 高档网站设计公司外贸营销网站制作公司
  • 做网站的条件电子商务网站建设的步骤
  • 百度竞价网站备案哈尔滨关键词优化报价
  • 福田大型商城网站建设网站浏览器
  • 网站自动优化百度指数搜索