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

【Git】git命令(全)

Git

  • 1、本地操作
  • 2、版本管理
  • 3、远端仓库
  • 4、分支管理
  • 5、缓存stash
  • 6、遗留rebase
  • 7、标签管理
  • 8、解决冲突
  • 9、参考教程
  • 10、示例代码

在这里插入图片描述

1、本地操作

  • Linux安装git:yum install git
  • 查看git版本 git version
  • 查看git设置 git config --list
  • 设置git属性 git config --global
  • 初始化git仓库:git init
  • 初始化git用户邮箱:git config --global user.email “rice_van@email.com”
  • 初始化git用户姓名:git config --global user.name “rice_van”
  • 添加到仓库:git add filename.txt
  • 提交到仓库:git commit -m “change messages”
  • 查看仓库状态:git status
  • 查看工作区修改区别:git diff
  • 查看工作区文件区别:git diff HEAD – filename.txt
  • 查看版本记录:git log
  • 查看简洁记录:git log --pretty=oneline
  • 查看命令记录:git reflog

2、版本管理

版本库提交流程:

  • 第一步是用git add把文件添加进去,实际上就是把文件修改添加到暂存区;
  • 第二步是用git commit提交更改,实际上就是把暂存区的所有内容提交到当前分支。
    在这里插入图片描述
  • 每次修改,如果不用git add到暂存区,那就不会加入到commit中
  • 第一次修改 -> git add -> 第二次修改 -> git add -> git commit
  • HEAD表示当前版本
  • HEAD^表示上一版本,上上版本HEAD^^
  • 前100次版本HEAD~100
    在这里插入图片描述
  • 回退最新提交:git reset --hard HEAD^ (即回到此版本的前一版本)
  • 回到指定版本:git reset --hard commit_id
  • 撤销暂存区修改,修改内容放回到工作区:git rest HEAD filename.txt
  • 撤销工作区修改:git checkout -- filename.txt
  • 回退本地误删文件:git checkout --filename.txt
  • 删除仓库文件:
    git rm filename.txt
    git commit -m “remove filename.txt”

3、远端仓库

  • 生成ssh秘钥:ssh-keygen -t rsa -C “xxxxxx@email.com”
  • 克隆远端仓库到本地:git clone git@github.com:xxxxx/learngit.git
  • 本地关联远程仓库:git remote add origin git@gitee.com:xxxxx/learngit.git
  • 查看远端仓库:git remote
  • 查看远程仓库信息:git remote -v
  • 删除远端关联关系:git remote rm origin
  • 本地修改推送远程仓库:git push origin master
  • 本地修改推送远程仓库:git push -u origin master
  • 推送到远端指定分支:git push origin originbranchname
  • 抓取远程分支到本地:git checkout -b branchname origin/branchname
  • 设置本地分支对应到远端指定分支:git branch --set-upstream-to=origin/branchname branchname
  • 本地分支与远端分支名不同时:git push origin HEAD:branchname (远端名)

尽量保持本地分支名与远端分支名一致

4、分支管理

  • 查看所有分支:git branch
  • 创建分支:git branch branchname
  • 删除分支:git branch -d branchname
  • 强行删除为合并分支:git branch -D branchname
  • 切换分支:git swtich branchname
  • 创建并切换分支:git swtich -c branchname
  • 合并到指定分支到当前分支:git merge branchname
  • 禁用Fast Forward方式合并:git merge --no-ff -m “messages” branchname (删除分支后可看合并历史)
  • 查看分支合并图:git log --graph
  • 查看分支合并图简易:git log --graph --pretty=oneline --abbrev-commit
  • 复制commit到当前分支:git cherry-pick commitid

5、缓存stash

  • 缓存修改:git stash
  • 缓存并标记:git stash -m “issue-01-2023.03.20:57”
  • 缓存列表:git stash list
  • 应用缓存:git stash apply
  • 删除缓存:git stash drop
  • 应用并删除:git stash pop
  • 应用某一缓存:git stash apply stash@{4}

6、遗留rebase

7、标签管理

  • 标签作用:标记commit,快速查看重要提交节点
  • 添加标签默认添加到当前分支的最新commit:git tag v1.0
  • 添加标签到指定commit:git tag v2.0 commitid
  • 添加标签与说明信息:git tag -a v3.0 -m “version 3.0 released”
  • 查看所有标签:git tag
  • 查看详细标签:git show v2.0
  • 删除标签:git tag -d v3.0
  • 推送标签到远程:git push origin v1.0
  • 推送所有标签:git push origin --tags
  • 删除远端标签:
    git tag -d v1.0
    git push origin :refs/tags/v1.0

8、解决冲突

  • 更新本地代码:git pull
  • 查看状态:git status
  • 手动修改,删除冲突内容
  • 重新提交:git add 、 git commit

9、参考教程

廖雪峰Git教程
Gitee教程

10、示例代码

[root@ecs-xxx ~]# git
-bash: git: command not found
[root@ecs-xxx ~]# 
[root@ecs-xxx ~]# sudo apt-get install git
sudo: apt-get: command not found
[root@ecs-xxx ~]# 
[root@ecs-xxx ~]# yum install git
Loaded plugins: fastestmirror
Complete!
[root@ecs-xxx ~]# git version
git version 1.8.3.1
[root@ecs-xxx ~]# whereis git
git: /usr/bin/git /usr/share/man/man1/git.1.gz
[root@ecs-xxx ~]# pwd
/root
[root@ecs-xxx /]# cd home
[root@ecs-xxx home]# mkdir learngit
[root@ecs-xxx home]# cd learngit
[root@ecs-xxx learngit]# pwd
/home/learngit
[root@ecs-xxx learngit]# git init
Initialized empty Git repository in /home/learngit/.git/
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# ls -a
.  ..  .git
[root@ecs-xxx learngit]# touch readme.txt
[root@ecs-xxx learngit]# ls
readme.txt
[root@ecs-xxx learngit]# vim readme.txt 
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
[root@ecs-xxx learngit]# git add readme.txt 
[root@ecs-xxx learngit]# git commit -m 'wrote a readme file.'*** Please tell me who you are.Rungit 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 'root@ecs-xxx.(none)')
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git config --global user.email "xxxxxx@email.com"
[root@ecs-xxx learngit]# git config --global user.name "xxxxxx"
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git config --list
user.email=xxxxxx@email.com
user.name=xxxxx
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@gitee.com:xxxxx/learngit.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git commit -m 'wrote a readme file.'
[master (root-commit) af264a5] wrote a readme file.1 file changed, 2 insertions(+)create mode 100644 readme.txt
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# cat readme.txt
Git is a version control system.
xf
[root@ecs-xxx learngit]# vim readme.txt 
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   readme.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git diff
diff --git a/readme.txt b/readme.txt
index 1a0762b..68fe139 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,2 +1,3 @@Git is a version control system.xf
+Git is free software.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git add readme.txt 
[root@ecs-xxx learngit]# git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   readme.txt
#
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git commit -m "add new line"
[master 910aa81] add new line1 file changed, 1 insertion(+)
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git status
# On branch master
nothing to commit, working directory clean
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]#
[root@ecs-xxx learngit]# vim readme.txt 
[root@ecs-xxx learngit]# git add readme.txt 
[root@ecs-xxx learngit]# git commit -m "add system time"
[master 331832a] add system time1 file changed, 1 insertion(+)
[root@ecs-xxx learngit]# git status
# On branch master
nothing to commit, working directory clean
[root@ecs-xxx learngit]#
[root@ecs-xxx learngit]# git log
commit af264a5ada2e059ad822d7121fa2e595129198de
Author: xxxxxx <xxxxxx@email.com>
Date:   Thu Mar 2 10:01:05 2023 +0800:
Date:   Thu Mar 2 10:06:21 2023 +0800add system timecommit 910aa81c9bade65244b9ba43a74f225dc931f22e
Author: xxxxxx <xxxxxx@email.com>
Date:   Thu Mar 2 10:03:55 2023 +0800add new linecommit af264a5ada2e059ad822d7121fa2e595129198de
Author: xxxxxx <xxxxxx@email.com>
Date:   Thu Mar 2 10:01:05 2023 +0800wrote a readme file.
[1]+  Stopped                 git log
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git log --pretty=oneline
331832aa56734d0f34517fd246ceb32b32ed20a2 add system time
910aa81c9bade65244b9ba43a74f225dc931f22e add new line
af264a5ada2e059ad822d7121fa2e595129198de wrote a readme file.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git reset --hard HEAD^
HEAD is now at 910aa81 add new line
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
Git is free software.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git log
commit 910aa81c9bade65244b9ba43a74f225dc931f22e
Author: xxxxxx <xxxxxx@email.com>
Date:   Thu Mar 2 10:03:55 2023 +0800add new linecommit af264a5ada2e059ad822d7121fa2e595129198de
Author: xxxxxx <xxxxxx@email.com>
Date:   Thu Mar 2 10:01:05 2023 +0800wrote a readme file.
[root@ecs-xxx learngit]# [root@ecs-xxx learngit]# touch license.txt
[root@ecs-xxx learngit]# vim license.txt 
[root@ecs-xxx learngit]# git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	license.txt
nothing added to commit but untracked files present (use "git add" to track)
[root@ecs-xxx learngit]# vim readme.txt 
[root@ecs-xxx learngit]# cat readme.txt
Git is a version control system.
xf
Git is free software.
2023/3/2
Git has a mutable index called stage.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   readme.txt
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	license.txt
no changes added to commit (use "git add" and/or "git commit -a")
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git add readme.txt 
[root@ecs-xxx learngit]# git add license.txt 
[root@ecs-xxx learngit]# git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	new file:   license.txt
#	modified:   readme.txt
#
[root@ecs-xxx learngit]# git commit -m "add new file license.txt"
[master 40b3936] add new file license.txt2 files changed, 2 insertions(+)create mode 100644 license.txt
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git status
# On branch master
nothing to commit, working directory clean
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
Git is free software.
2023/3/2
Git has a mutable index called stage.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# vi readme.txt 
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
Git is free software.
2023/3/2
Git has a mutable index called stage.
My stupid boss.
[root@ecs-xxx learngit]# git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   readme.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git checkout -- readme.txt 
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
Git is free software.
2023/3/2
Git has a mutable index called stage.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# vi readme.txt 
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
Git is free software.
2023/3/2
Git has a mutable index called stage.
Fuck!!
[root@ecs-xxx learngit]# git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   readme.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git add readme.txt 
[root@ecs-xxx learngit]# git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   readme.txt
#
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git reset HEAD readme.txt 
Unstaged changes after reset:
M	readme.txt
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
Git is free software.
2023/3/2
Git has a mutable index called stage.
Fuck!!
[root@ecs-xxx learngit]# git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   readme.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git checkout -- readme.txt 
[root@ecs-xxx learngit]# git status
# On branch master
nothing to commit, working directory clean
[root@ecs-xxx learngit]# cat readme.txt 
Git is a version control system.
xf
Git is free software.
2023/3/2
Git has a mutable index called stage.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# touch test.txt
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	test.txt
nothing added to commit but untracked files present (use "git add" to track)
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git add test.txt 
[root@ecs-xxx learngit]# git commit -m "add test.txt"
[master cd18992] add test.txt1 file changed, 0 insertions(+), 0 deletions(-)create mode 100644 test.txt
[root@ecs-xxx learngit]# git status
# On branch master
nothing to commit, working directory clean
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# rm test.txt 
rm: remove regular empty file ‘test.txt’? y
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# ls
license.txt  readme.txt
[root@ecs-xxx learngit]# git status
# On branch master
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	deleted:    test.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
[root@ecs-xxx learngit]# git checkout -- test.txt
[root@ecs-xxx learngit]# ls
license.txt  readme.txt  test.txt
[root@ecs-xxx learngit]# 
[root@ecs-fjx learngit]# 
[root@ecs-fjx learngit]# git reflog
6aca85e HEAD@{0}: rebase finished: returning to refs/heads/master
6aca85e HEAD@{1}: pull --rebase origin master: add test.txt
1149b68 HEAD@{2}: pull --rebase origin master: add new file license.txt
283dd5f HEAD@{3}: pull --rebase origin master: add system time
92808ba HEAD@{4}: pull --rebase origin master: add new line
2b29c43 HEAD@{5}: pull --rebase origin master: wrote a readme file.
58bbad5 HEAD@{6}: checkout: moving from master to 58bbad55beedbb8e07a334b18dcf0694ab6fa291^0
cd18992 HEAD@{7}: commit: add test.txt
40b3936 HEAD@{8}: commit: add new file license.txt
331832a HEAD@{9}: reset: moving to 331832
910aa81 HEAD@{10}: reset: moving to HEAD^
331832a HEAD@{11}: commit: add system time
910aa81 HEAD@{12}: commit: add new line
af264a5 HEAD@{13}: commit (initial): wrote a readme file.
[root@ecs-fjx learngit]# [root@ecs-xxx ~]# ssh-keygen -t rsa -C "xxxxxx@email.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX email@email.com
The key's randomart image is:
+---[RSA 2048]----++----[SHA256]-----+
[root@ecs-xxx ~]# 
[root@ecs-xxx ~]# ls -a
.   .bash_history  .bash_profile  .cshrc      .history           .pki  .tcshrc
..  .bash_logout   .bashrc        .gitconfig  mirrors_source.sh  .ssh  .viminfo
[root@ecs-xxx ~]# cd .ssh
[root@ecs-xxx .ssh]# ls 
authorized_keys  id_rsa  id_rsa.pub
[root@ecs-xxx .ssh]# cat id_rsa.pub 
[root@ecs-xxx learngit]# git remote add origin git@gitee.com:xxxxx/learngit.git
[root@ecs-xxx learngit]# git remote -v
origin	git@gitee.com:xxxxx/learngit.git (fetch)
origin	git@gitee.com:xxxxx/learngit.git (push)
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git status
# On branch master
nothing to commit, working directory clean
[root@ecs-xxx learngit]# [root@ecs-xxx learngit]# git pull
warning: no common commits
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From gitee.com:xxxxx/learngit* [new branch]      develop    -> origin/develop* [new branch]      feature    -> origin/feature* [new branch]      master     -> origin/master* [new branch]      release    -> origin/release
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for detailsgit pull <remote> <branch>If you wish to set tracking information for this branch you can do so with:git branch --set-upstream-to=origin/<branch> master[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# ls 
license.txt  readme.txt  test.txt
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git push -u origin master
Warning: Permanently added the ECDSA host key for IP address '212.64.63.190' to the list of known hosts.
To git@gitee.com:xxxxx/learngit.git! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:xxxxx/learngit.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git pull --reabse origin master
error: unknown option `reabse'
usage: git fetch [<options>] [<repository> [<refspec>...]]or: git fetch [<options>] <group>or: git fetch --multiple [<options>] [(<repository> | <group>)...]or: git fetch --all [<options>]-v, --verbose         be more verbose-q, --quiet           be more quiet--all                 fetch from all remotes-a, --append          append to .git/FETCH_HEAD instead of overwriting--upload-pack <path>  path to upload pack on remote end-f, --force           force overwrite of local branch-m, --multiple        fetch from multiple remotes-t, --tags            fetch all tags and associated objects-n                    do not fetch all tags (--no-tags)-p, --prune           prune remote-tracking branches no longer on remote--recurse-submodules[=<on-demand>]control recursive fetching of submodules--dry-run             dry run-k, --keep            keep downloaded pack-u, --update-head-ok  allow updating of HEAD ref--progress            force progress reporting--depth <depth>       deepen history of shallow clone--unshallow           convert to a complete repository[root@ecs-xxx learngit]# git pull --rebase origin master
From gitee.com:xxxxx/learngit* branch            master     -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: wrote a readme file.
Applying: add new line
Applying: add system time
Applying: add new file license.txt
Applying: add test.txt
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# ls 
license.txt  README.en.md  README.md  readme.txt  test.txt
[root@ecs-xxx learngit]# 
[root@ecs-xxx learngit]# git push -u origin master
Counting objects: 17, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (16/16), 1.32 KiB | 0 bytes/s, done.
Total 16 (delta 6), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-6.4]
To git@gitee.com:xxxxx/learngit.git58bbad5..6aca85e  master -> master
Branch master set up to track remote branch master from origin.
[root@ecs-xxx learngit]# 

相关文章:

【Git】git命令(全)

Git1、本地操作2、版本管理3、远端仓库4、分支管理5、缓存stash6、遗留rebase7、标签管理8、解决冲突9、参考教程10、示例代码1、本地操作 Linux安装git&#xff1a;yum install git查看git版本 git version查看git设置 git config --list设置git属性 git config --global初始…...

软考论文-成本管理(1)

成本管理 1.成本管理的主要内容&#xff1f; 规划成本&#xff1a;制定一个成本管理的计划。估算成本&#xff1a;根据项目范围说明书&#xff0c;项目管理计划和wbs等文档&#xff0c;采用xxx方法进行估算成本成本预算&#xff1a;可以算工作包的费用&#xff0c;制定预算和…...

Java 多线程 --- 锁的概念和类型划分

Java 多线程 --- 锁的概念和类型划分锁的概念乐观锁与悲观锁公平锁与非公平锁什么是可重入锁独占锁与共享锁轻量级锁和重量级锁自旋锁 (Spinlock)锁的概念 锁可以将多个线程对共享数据的并发访问转换为串行访问, 这样一个共享数据一次只能被一个线程访问, 该线程访问结束后其他…...

python程序员狂飙上头——京海市大嫂单推人做个日历不过分吧?

嗨害大家好鸭&#xff01;我是小熊猫~ 这个反黑剧其实火了很久了&#xff0c; 但是我现在才有空开始看 该说不说&#xff0c;真的很上头&#xff01;&#xff01;&#xff01; 大嫂简直就像是干枯沙漠里的玫瑰 让人眼前一亮哇~~ 我小熊猫此时此刻就成为大嫂的单推人&…...

浅谈子网掩码、IP地址、网络地址之间关系

文章目录一、什么是子网掩码二、给定IP地址&#xff0c;如何求网络地址网络标识&#xff08;net-id&#xff09;和主机标识&#xff08;host-id&#xff09;计算步骤三、CIDR地址表示方法(Classless Inter Domain Routing)四、IP地址与MAC地址一、什么是子网掩码 在TCP/IP协议…...

前端优化的解决方案

能缓存的&#xff0c;尽量强缓存。减少HTTP请求数 使用外部引入的css和js文件&#xff0c;并且引入的css和js越少越好使用雪碧图&#xff08;精灵图&#xff09;img计算缩放也需要时间&#xff0c;使用base64编码将较小图片嵌入到样式表中&#xff0c;减少请求数因为iframe会阻…...

PYthon组合数据类型的简单使用

Python的数据类型有两种&#xff0c;基本数据类型和组合数据类型&#xff0c;组合数据类型在Python的使用中特别重要。 1.组合数据类型的分类&#xff1a; 2.序列类型 序列类型中元素存在顺序关系&#xff0c;可以存在数值相同但位置不同的元素。序列类型支持成员关系操作符&…...

【Java】P2 基础语法与运算符

Java 基础语法 运算符Java注释方法基本数据类型驼峰命名法Scanner类基本运算除法隐式转换逻辑运算符 以及 短路逻辑运算符三元运算符前言 上一节内容涵盖Java的基础知识&#xff0c;包含安装下载&#xff0c;JDK与JRE等。 链接&#xff1a;https://blog.csdn.net/weixin_43098…...

【并发基础】Java中线程的创建和运行以及相关源码分析

目录 一、线程的创建和运行 1.1 创建和运行线程的三种方法 1.2 三者之间的继承关系 二、Thread类和Runnable接口的区别 2.1 Runnable接口可以实现线程之间资源共享&#xff0c;而Thread类不能 2.2 实现Runnable接口相对于继承Thread类的优点 三、实现 Runnable 接口和实现 Call…...

Spark Shuffle

Shuffle : 集群范围内跨节点、跨进程的数据分发 分布式数据集在集群内的分发&#xff0c;会引入大量的磁盘 I/O 与网络I/O在 DAG 的计算中&#xff0c;Shuffle 环节的执行性能是最差的 , 会消耗所有类型的硬件资源 (CPU、内存、磁盘、网络) Spark 2.0 后&#xff0c;将 Shuff…...

Linux/MacOS 生成双击可执行文件

双击可执行文件包含两种&#xff1a;终端shell脚本 Unix可执行文件 1.终端shell脚本 随意新建一个文件&#xff08;可使用command键N&#xff0c;前提是有已打开的文件&#xff09;&#xff0c;输入shell格式的测试代码&#xff0c;比如&#xff1a; #! /bin/sh echo “h…...

Ubuntu三种拨号方法

1.宽带拨号(PPPoE) (1)打开连接。关闭以太网连接&#xff0c;打开有线连接设置&#xff0c;取消勾选“自动连接”选项。 (2)配置连接。在终端输入命令sudo pppoeconf&#xff0c;会看到一系列配置信息&#xff0c;包括用户名、密码&#xff0c;配置完成后会有一些提示信息&…...

Vue-router的引入和安装

什么是Vue-Router&#xff1f;Vue路由器是Vue.js的官方路由器&#xff0c;它与Vue.js核心深度集成&#xff0c;使用Vue轻松构建单页应用程序变得轻而易举。功能包括&#xff1a;嵌套路线映射动态路由模块化&#xff0c;基于组件的路由器配置路由参数&#xff0c;查询&#xff0…...

无线WiFi安全渗透与攻防(四)之kismet的使用

系列文章 无线WiFi安全渗透与攻防(一)之无线安全环境搭建 无线WiFi安全渗透与攻防(二)之打造专属字典 无线WiFi安全渗透与攻防(三)之Windows扫描wifi和破解WiFi密码 kismet 如果要进行无线网络渗透测试&#xff0c;则必须先扫描所有有效的无线接入点。刚好在Kali Linux中&am…...

2023新版PMP考试有哪些变化?

对于2022年很多事情也都在发生&#xff0c;疫情也都没有完全结束&#xff0c;基金会已经开始通知下一场考试了&#xff0c;很多人也会担心新的考纲会不会给自己带来难度&#xff0c;其实这次六月份的考试很多人都内心已经知道了结果&#xff0c;所以这里也详细说一下新考纲的改…...

P8074 [COCI2009-2010#7] SVEMIR 最小生成树

[COCI2009-2010#7] SVEMIR 题目描述 太空帝国要通过建造隧道来联通它的 NNN 个星球。 每个星球用三维坐标 (xi,yi,zi)(x_i,y_i,z_i)(xi​,yi​,zi​) 来表示&#xff0c;而在两个星球 A,BA,BA,B 之间建造隧道的价格为 min⁡{∣xA−xB∣,∣yA−yB∣,∣zA−zB∣}\min\{|x_A-x_…...

10种常见网站安全攻击手段及防御方法

在某种程度上&#xff0c;互联网上的每个网站都容易遭受安全攻击。从人为失误到网络罪犯团伙发起的复杂攻击均在威胁范围之内。 网络攻击者最主要的动机是求财。无论你运营的是电子商务项目还是简单的小型商业网站&#xff0c;潜在攻击的风险就在那里。 知己知彼百战不殆&…...

为什么我选择收费的AdsPower指纹浏览器?

在决定开始用指纹浏览器之前&#xff0c;龙哥让我们团队的运营小哥找了市面上很多产品去测试。最后&#xff0c;还是决定用AdsPower。每个人的使用感受都不一样&#xff0c;龙哥就说说几个用得顺手的几个点。一、指纹环境强大 双内核引擎 市面上指纹浏览器内核都是基于谷歌Chro…...

Java输入输出和数组

一、问答题 1. 如何声明和创建一个一维数组&#xff1f; Int i[]new int[3] 2. 如何访问数组的元素&#xff1f; Int a[]new int a[3] for (int x0;x<a.length;x){ System.out.print(i[x]); } System.out.println(); 3.数组下标的类型是什么&#xff1f;最小的下标是什…...

这些免费API帮你快速开发,工作效率杠杠滴

一、短信发送 短信的应用可以说是非常的广泛了&#xff0c;短信API也是当下非常热门的API~ 短信验证码&#xff1a;可用于登录、注册、找回密码、支付认证等等应用场景。支持三大运营商&#xff0c;3秒可达&#xff0c;99.99&#xff05;到达率&#xff0c;支持大容量高并发。…...

干货|最全PCB布线教程总结,14条PCB布线原则技巧,保姆级搞定PCB布线

1、坚持手动布线&#xff0c;慎用自动布线2、了解制造商的规格3、合适的走线宽度4、迹线之间留出足够的空间5、元器件放置6、保持模拟和数字走线分开7、接地层8、走线和安装孔留有足够的空间9、交替走线方向10、避免电容耦合11、放置散热孔和焊盘12、接地和电源走线13、利用丝印…...

编程快捷键和markdown语法小计

Data Structure FQA文章目录1.idea快捷键汇总2.markdown一些常用语法1.idea快捷键汇总 altenter  快捷生成变量 altInsert可以新建类&#xff0c;文件&#xff0c;get或set方法&#xff0c;此快捷键又名创造一切 编辑区和文件区的跳转。 alt 1  &#xff1a;编辑区跳转至…...

内网vCenter部署教程二,最全的了!

一、组网说明 vCenter组网最佳实践 每台服务器需要6个网口,需要三个分布式交换机,每个交换机分配2个物理网卡做冗余,分别做为管理网络、业务网络、高可用网络使用。另vsan网络和vmotion网络可以复用业务网络或管理网络,vcenter HA需要单独用一个网络。 二、创建管理网络…...

2023-3-2 刷题情况

迷宫 题目描述 这天, 小明在玩迷宫游戏。 迷宫为一个 nn 的网格图, 小明可以在格子中移动, 左上角为 (1,1), 右 下角 (n,n) 为终点。迷宫中除了可以向上下左右四个方向移动一格以外, 还有 m 个双向传送门可以使用, 传送门可以连接两个任意格子。 假如小明处在格子 (x1,y1)(…...

Docker SYS_ADMIN 权限容器逃逸

1.漏洞原理Docker容器不同于虚拟机&#xff0c;它共享宿主机操作系统内核。宿主机和容器之间通过内核命名空间&#xff08;namespaces&#xff09;、内核Capabilities、CGroups&#xff08;control groups&#xff09;等技术进行隔离。若启动docker容器时给主机一个--cap-addSY…...

【Kotlin】 yyyy-MM-dd HH:mm:ss 时间格式 时间戳 全面解读超详细

时间格式 时间格式(协议)描述gg时期或纪元。y不包含纪元的年份。不具有前导零。yy不包含纪元的年份。具有前导零。yyyy包含纪元的四位数的年份。M月份数字。一位数的月份没有前导零。MM月份数字。一位数的月份有一个前导零。MMM月份的缩写名称&#xff0c;在AbbreviatedMonthN…...

git repack多包使用及相关性能测试

1、git数据结构 git 中存在四种数据结构&#xff0c;即object包含四种&#xff0c;分别是tree对象、blob对象、commit对象、tag对象 1.1 blob对象 存储文件内容&#xff0c;内容是二进制的形式&#xff0c;通过SHA-1算法对文件内容和头信息进行计算得到key(文件名)。 如果一…...

QT获取dll库文件详细信息

一、需求背景获取软件下依赖的dll库的版本信息&#xff0c;如下图所示版本为1.0.7.1018二、实现方法2.1步骤windows下实现&#xff0c;基于version.lib(version.dll)提供的函数获取这些信息首先使用GetFileVersionInfoSizeA(W)获取VersionInfo的大小&#xff0c;申请缓冲区&…...

常见的电脑运行卡顿原因及解决方法

大家在日常使用电脑过程中&#xff0c;会发现多开几个文件就卡顿&#xff0c;其实很多时候都跟C盘长期不清理有关&#xff0c;C盘的内存被下载的软件安装包、页面文件、休眠文件、更新文件等一系列的文件占据。大的文件甚至能占到20-30G&#xff0c;驱动人生就为大家带来几种解…...

案例08-让软件的使用者成为软件的设计者

一&#xff1a;背景介绍 对于需求的开发每天可能都会有上线的情况&#xff0c;为了防止每次上线拉取代码或者修改配置而引发的冲突以及发生了冲突应该找谁一起确定一下代码留下那一部分的情况。所以在开发的群中会有一个表格来记录每个需求上线修改的环境、是否修改数据库、是否…...

网络游戏网站网址大全/seo网站优化知识

缓存雪崩&#xff0c;缓存穿透&#xff0c;缓存预热&#xff0c;缓存热备是在做缓存设计或者缓存应用时经常遇到的概念&#xff0c;也是缓存应用过程中必须熟知及知道 的东西。 缓存雪崩 当缓存处于单点情况下&#xff0c;一旦缓存服务器崩溃&#xff0c;所有的请求就会落到数…...

wordpress高级版破解版/域名查询官网

你好,欢迎来到第 24 课时,本课时主要讲解 Flink 消费 Kafka 数据开发。 在上一课时中我们提过在实时计算的场景下,绝大多数的数据源都是消息系统,而 Kafka 从众多的消息中间件中脱颖而出,主要是因为高吞吐、低延迟的特点;同时也讲了 Flink 作为生产者像 Kafka 写入数据的…...

网站添加新闻栏怎么做/雷神代刷推广网站

http://www.sosuo8.com/article/show.asp?id850&page0 转载于:https://www.cnblogs.com/xioxu/archive/2008/01/30/1058939.html...

支付宝签约网站/seo关键词优化培训班

目录 方式1&#xff1a;每个频率持续一段时间 方式二&#xff1a;每个频率采样一个点 方式1&#xff1a;每个频率持续一段时间 % % 作者&#xff1a; jialf % 时间&#xff1a; 2020/3/22 % 版本&#xff1a; V1 % FM线性调频仿真 Fs 30.72*10^6; %采样频率 period 1000; …...

wordpress全站301/市场营销推广方案模板

点击上方"brucepk"&#xff0c;选择"置顶公众号"第一时间关注 Python 技术干货&#xff01;阅读文本大概需要 3 分钟。自从 pk哥开始认真在公众号分享文章以来&#xff0c;目前已分享了 45 篇原创文章&#xff0c; 昨晚花了几小时对公众号文章进行了整理&a…...

wordpress 限制游客/企业网站策划

调度算法一、先来先服务FCFS (First Come First Serve)1.思想&#xff1a;选择最先进入后备/就绪队列的作业/进程&#xff0c;入主存/分配CPU2.优缺点优点&#xff1a;对所有作业/进程公平&#xff0c;算法简单稳定缺点&#xff1a;不够灵活&#xff0c;对紧急进程的优先处理权…...