VS2015发布安装包1

编译工程

编写并调试你的工程,保证工程能编译运行

2
查看框架

项目 -> xx属性(P)… -> 应用程序

查看目标框架(修改后请重新编译工程以确保可行性)

Alt text

生成

生成 -> 配置选择release
Alt text

创建数字签名证书(已有可跳过此步)

使用OFFICE工具下的VBA项目的数字证书工具生成一个证书

  • 或自行搜索数字证书生成方法

Alt text

签名

签名 -> 选中为clickonce清单签名 -> 从存储区选择

Alt text

发布准备

发布 -> 发布文件夹位置(生成的安装包的位置)

发布 -> 应用程序文件(查看需要打包的文件)

发布 -> 系统必备组件(选择需要安装的必备组件)

发布 -> 选项(设置发布语言,发行者名称等)

发布 -> 发布版本(就是版本号)

Alt text

准备系统必备组件(以 .NET Framework 4.5.2为例)

发布 -> 系统必备组件

选中 创建用于安装系统必备组件的安装程序

选中 Microsoft .NET Framework 4.5.2 (x86 和 x64)

选中 从与我的应用程序相同的位置下载系统必备组件

Alt text

准备系统必备组件安装包(以 .NET Framework 4.5.2为例)

点击立即发布

在错误列表中查看缺失的安装包

从网上下载对应的离线安装包

微软下载https://www.microsoft.com/en-us/search/DownloadResults.aspx?FORM=DLC&ftapplicableproducts=%5e%22AllDownloads%22&sortby=+weight&q=developer+software

Alt text

准备系统必备组件安装包(以 .NET Framework 4.5.2为例)

离线安装包下载完后

把英文版安装包(ENU)拷贝到 %VS安装目录%\SDK\Bootstrapper\Packages\DotNetFX452\

把语言包(CNS等)拷贝到 %VS安装目录%\SDK\Bootstrapper\Packages\DotNetFX452\zh-Hans(或其他对应语言)\

*默认VS安装目录为 C:\Program Files (x86)\Microsoft Visual Studio 14.0

Alt text

准备系统必备组件安装包(以 .NET Framework 4.5.2为例)

再次点击立即发布

如果有以下警告,可参照下一步

也可以忽略警告,跳过下一步

Alt text

特性值不匹配警告(以 .NET Framework 4.5.2为例)

右键英文版安装包 -> 属性 -> 数字签名 -> 选中列表 -> 详细信息 -> 查看证书 -> 详细信息 -> 公钥 -> 复制内容到文本文档并删除空格

右键编辑英文版安装包位置下 %VS安装目录%\SDK\Bootstrapper\Packages\DotNetFX452\product.xml

用上述公钥内容替换掉PublicKey的值

中文语言包安装包操作方法同上

Alt text

Alt text

发布

点击立即发布

发布成功后,你就可以把整个发布文件夹打包发给别人安装了

  • Application Files 文件夹内存放有所有历史版本的信息,你可以把旧版本的文件夹删除,只保留最新的版本文件夹

  • dotnetfx452 文件夹内存放的是系统必备组件安装包

  • setup.exe 就是安装程序

Alt text

vbs操作txt文本文件常用方法

创建文件

dim fso, f
set fso = server.CreateObject(“Scripting.FileSystemObject”)
set f = fso.CreateTextFile(“C:\test.txt”, true) ‘第二个参数表示目标文件存在时是否覆盖
f.Write(“写入内容”)
f.WriteLine(“写入内容并换行”)
f.WriteBlankLines(3) ‘写入三个空白行(相当于在文本编辑器中按三次回车)
f.Close()
set f = nothing
set fso = nothing


打开并读文件

dim fso, f
set fso = server.CreateObject(“Scripting.FileSystemObject”)
set f = fso.OpenTextFile(“C:\test.txt”, 1, false) ‘第二个参数 1 表示只读打开,第三个参数表示目标文件不存在时是否创建
f.Skip(3) ‘将当前位置向后移三个字符
f.SkipLine() ‘将当前位置移动到下一行的第一个字符,注意:无参数
response.Write f.Read(3) ‘从当前位置向后读取三个字符,并将当前位置向后移三个字符
response.Write f.ReadLine() ‘从当前位置向后读取直到遇到换行符(不读取换行符),并将当前位置移动到下一行的第一个字符,注意:无参数
response.Write f.ReadAll() ‘从当前位置向后读取,直到文件结束,并将当前位置移动到文件的最后
if f.atEndOfLine then
response.Write(“一行的结尾!”)
end if
if f.atEndOfStream then
response.Write(“文件的结尾!”)
end if
f.Close()
set f = nothing
set fso = nothing


打开并写文件

dim fso, f
set fso = server.CreateObject(“Scripting.FileSystemObject”)
set f = fso.OpenTextFile(“C:\test.txt”, 2, false) ‘第二个参数 2 表示重写,如果是 8 表示追加
f.Write(“写入内容”)
f.WriteLine(“写入内容并换行”)
f.WriteBlankLines(3) ‘写入三个空白行(相当于在文本编辑器中按三次回车)
f.Close()
set f = nothing
set fso = nothing


判断文件是否存在

dim fso
set fso = server.CreateObject(“Scripting.FileSystemObject”)
if fso.FileExists(“C:\test.txt”) then
response.Write(“目标文件存在”)
else
response.Write(“目标文件不存在”)
end if
set fso = nothing


移动文件

dim fso
set fso = server.CreateObject(“Scripting.FileSystemObject”)
call fso.MoveFile(“C:\test.txt”, “D:\test111.txt”) ‘两个参数的文件名部分可以不同
set fso = nothing


复制文件

dim fso
set fso = server.CreateObject(“Scripting.FileSystemObject”)
call fso.CopyFile(“C:\test.txt”, “D:\test111.txt”) ‘两个参数的文件名部分可以不同
set fso = nothing


删除文件

dim fso
set fso = server.CreateObject(“Scripting.FileSystemObject”)
fso.DeleteFile(“C:\test.txt”)
set fso = nothing


创建文件夹

dim fso
set fso = server.CreateObject(“Scripting.FileSystemObject”)
fso.CreateFolder(“C:\test”) ‘目标文件夹的父文件夹必须存在
set fso = nothing


判断文件夹是否存在

dim fso
set fso = server.CreateObject(“Scripting.FileSystemObject”)
if fso.FolderExists(“C:\Windows”) then
response.Write(“目标文件夹存在”)
else
response.Write(“目标文件夹不存在”)
end if
set fso = nothing


删除文件夹

dim fso
set fso = server.CreateObject(“Scripting.FileSystemObject”)
fso.DeleteFolder(“C:\test”) ‘文件夹不必为空
set fso = nothing

Regex 正则表达式

正则表达式(Regular Expression简写为Regex),又称为规则表达式,它是一种强大的文本匹配模式,其用于在字符串中查找匹配符合特定规则的子串。

正则表达式由一些普通字符(比如英文字母,数字)和元字符(代表特定含义)组成。

正则表达式作为一个字符模板,在字符串中匹配一个或多个符合特定规则的子串。

基本匹配

正则表达式其实就是在执⾏搜索时的格式,它由⼀些字⺟和数字组合⽽成。 例如:⼀个正则表达式 the ,它表示⼀个规则:由字⺟t 开始,接着是h ,再接着是e 。
“the” => The fat cat sat on the mat.
正则表达式123匹配字符串123。它逐个字符的与输⼊的正则表达式做⽐较。
正则表达式是⼤⼩写敏感的,所以The不会匹配the。
“The” => The fat cat sat on the mat.

\ 转义字符,常用于转义元字符

反斜线 \ 在表达式中⽤于转义紧跟其后的字符。⽤于指定 { } [ ] / \ + * . $ ^ | ? 这些特殊字符。

\s搜索空格,这个小写的s有“空格”之意。此模式不仅匹配空格,还包括回车符、制表符、换页符和换行符等字符。你可以将其看做与字符集[\r\t\f\n\v]类似。

\S搜索非空格。使用它将不再匹配回车符、制表符、换页符和换行符等字符,也可用否定字符集[^\r\t\f\n\v]表示。

空白字符有:空格(‘ ’)、换页(‘\f’)、换行(‘\n’)、回车(‘\r’)、水平制表符(‘\t’)、垂直制表符(‘\v’)六个。

\f 匹配换页符

换页: \f = U+000c
在打印机上,加载下一页.在某些终端模拟器中,它会清除屏幕.

\n 匹配换行符
\r 匹配回车符

终端中,回车效果是输出回到本行行首,结果可能会将这一行之前的输出覆盖掉

在文本文件中
在Windows平台上,换行符是回车符(CR,Carriage Return)和换行符(LF,Line Feed)的组合(即CRLF);在Unix/Linux平台上,换行符只是一个LF字符;在MacOS上,换行符是一个CR字符。

setting -> eol -> \n (LF)

\t 匹配制表符
\v 匹配垂直制表符

垂直制表: \v = U+000b
将表单放在下一行标签位置.

一般文本编辑器对\r \v \f 的显示是没有控制效果的。

qita

\w \d \s

元字符

元字符. 可匹配任意(除了换行符\n)的单字符,意思就是. 可以代表任意(除了换行符\n)的单字符。

定位符

单词边界\b与\B

符号\b 是指一个单词边界,比如空白字符和标点符号、其他符号(如-)、换行符等。
符号\B 表示非单词边界。

开始位置^与结束位置$

符号^ 表示匹配的子串在行首,符号$ 表示匹配的子串在行尾。

限定符用于限定一个子表达式出现的次数,一共6 种

字符 含义
* 匹配前面的子表达式零次或多次
+ 匹配前面的子表达式一次或多次
? 匹配前面的子表达式零次或一次
{n} 匹配前面的子表达式n次
{n,} 匹配前面的子表达式至少n次
{n,m} 匹配前面的子表达式n 到m 次

符号*

模式串ab*c,表示字符a和c 之间需要出现0 次或多次字符b。

符号+

模式串ab+c,表示字符a和c 之间需要出现1 次或多次字符b,即至少出现1次字符b。

符号?

模式串ab?c,表示字符a和c 之间需要出现0 次或1次字符b。

符号{n}和{n,}和{n,m}
ab{3}c:符号b 出现的次数必须是3
ab{3,}c:符号b 出现的次数必须大于等于3
ab{3,5}c:符号b 出现的次数必须在3 和5之间,包括3 和 5

不常用

贪婪匹配和懒惰匹配

*和 + 限定符都是贪婪的,因为它们会尽可能多的匹配文字,只有在它们的后面加上一个 ? 就可以实现非贪婪或最小匹配。

在正则表达式中,可用贪婪(greedy)匹配查找符合正则表达式的字符串的最长的可能字符串,并将其作为匹配结果返回。而懒惰(lazy)匹配是查找符合正则表达式的字符串的最短的可能字符串。

正则表达式默认采⽤贪婪匹配模式,在该模式下意味着会匹配尽可能⻓的⼦串。
我们可以使⽤ ? 将贪婪匹配模式转化为惰性匹配模式。 “.at” => The fat cat sat on the mat.
“.
?at” => The fat cat sat on the mat.

lizi:

玩儿吃鸡游戏,晚上一起上游戏,干嘛呢?打游戏啊

玩.*游戏
玩儿吃鸡游戏,晚上一起上游戏,干嘛呢?打游戏

玩.*?游戏
玩儿吃鸡游戏

逻辑或|

符号 | 写在两个子表达式之间表示逻辑或的意思。

字符簇[]

写在中括号[] 内的多个字符代表逻辑或的意思。

模式串a[bef]c,表示a和c中间的字符必须是b或e或f。

当符号^ 写在中括号[] 内时,表示逻辑非的意思。

模式串a[^bef]c,表示a和c中间的字符不能是b或e或f。

符号- 写在中括号[],表示范围的意思:

示例 含义
[a-z] 表示a 到z 之间的任意字符
[A-Z] 表示A 到Z 之间的任意字符
[0-9] 表示0 到9 之间的任意数字,含义同\d
[^0-9] 表示任意非数字,含义同\D
[A-Za-z0-9_] 表示任意字母,数字或下划线,含义同\w
[^A-Za-z0-9_] 表示任意非字母,非数字,非下划线,含义同\W
[ \f\r\t\n] 表示任意的空白字符,含义同\s
[^ \f\r\t\n] 表示任意的非空白字符,含义同\S

字符组合()

写在小括号()中的多个字符,会被看成一个整体。

(…) 中包含的内容将会被看成⼀个整体,和数学中⼩括号 () 的作⽤相同。
例如, 表达式 (ab)匹配连续出现 0 或更多个 ab 的字符串 。 如果
没有使⽤ (…) ,那么表达式 ab
将匹配连续出现 0 或更多个 b 。

再⽐如之前说的 {} 是⽤来表示前⾯⼀个字符出现指定次数。
但如果在 {} 前加上特征标群(…) 则表示整个标群内的字符重复 n 次。

我们还可以在 () 中⽤ 或字符 | 表示或。 例如, (c|g|p)ar 匹配 car 或 gar 或 par

“(c|g|p)ar” => The car is parked in the garage.

(abc){2,}
abc出现的次数必须大于等于2

Alt text

捕获组

使用捕获组复用模式

正则表达式中的字符串模式多次出现,手动重复输入这些正则表达式是浪费时间的。有一个更好的方法可以用于你的字符串中有多个重复子串时进行指定,这个方法就是捕获组。

用括号”()”可以定义捕获组,用于查找重复的子串,即把会重复的字符串模式的正则表达式放在括号内。

要指定重复字符串出现的位置,可以使用反斜线”" + 数字的形式。该数字从1开始,并随着用括号定义的捕获组数量而增加。比如\1匹配正则表达式中通过括号定义的第一个捕获组。

使用捕获组来匹配字符串中连续出现3次的数字,每个数字由空格分隔,正则表达式为

(\d+)\s\1\s\1

\1代表捕获组(\d+)内正则表达式匹配的结果,而不是正则表达式\d+。因此,这个正则表示可以匹配123 123 123,但是不能匹配120 210 220。

(注意:是先捕获后复用,即先执行表达式得到结果之后再复用)

在替换中使用捕获组复用模式

如果我们在搜索替换中希望保留搜索字符串中的某些字符串作为替换字符串的一部分,可以使用”$”符号访问搜索字符串中的捕获组。

比如,在搜索正则表达式中的捕获组为capture groups,则替换的正则表达式中可以直接使用$1复用搜索正则表达式中的捕获组capture groups。

在VSCode中,如果想要把项目中所有的HTML标签中的h改为H,搜索正则表达式<h(\d)>就可以查找出所有标签,如<h1>、<h2>、<h3>、<h4>等,其中还定义了捕获组(\d)。 替换的正则表达式<H$1>使用$1复用了搜索正则表达式中定义的捕获组(\d),如下图所示。

Alt text

(pattern)

匹配 pattern 并获取这一匹配。所获取的匹配可以从产生的 Matches 集合得到,在VBScript 中使用 SubMatches 集合,在JScript 中则使用 $0…$9 属性。要匹配圆括号字符,请使用 ‘(‘ 或 ‘)‘。

(?:pattern)

匹配 pattern 但不获取匹配结果,也就是说这是一个非获取匹配,不进行存储供以后使用。

这在使用 “或” 字符 (|) 来组合一个模式的各个部分是很有用。例如, ‘industr(?:y|ies) 就是一个比 ‘industry|industries’ 更简略的表达式。

(?=pattern)

正向肯定预查(look ahead positive assert),在任何匹配pattern的字符串开始处匹配查找字符串。

这是一个非获取匹配,也就是说,该匹配不需要获取供以后使用。

例如,”Windows(?=95|98|NT|2000)”能匹配”Windows2000”中的”Windows”,但不能匹配”Windows3.1”中的”Windows”。

预查不消耗字符,也就是说,在一个匹配发生后,在最后一次匹配之后立即开始下一次匹配的搜索,而不是从包含预查的字符之后开始。

| (exp) | 匹配exp并捕获到自动命名的组中
| (?<name&>exp) | 匹配exp并捕获到名为name的组中
| (?:exp) | 匹配exp但是不捕获匹配的文本
| (?=exp) | 匹配exp前面的位置
| (?<=exp) | 匹配exp后面的位置


(?<name>exp) 匹配exp并捕获到名为name的组中

*? 重复任意次,但尽可能少重复
a.b
a.
?b
将正则表达式应用于aabab,前者会匹配整个字符串aabab,后者会匹配aab和ab两个字符串

+? 重复1次或多次,但尽可能少重复
?? 重复0次或1次,但尽可能少重复
{M,N}? 重复M到N次,但尽可能少重复
{M,}? 重复M次以上,但尽可能少重复

markdown

1.1. 目录

create table of content

update section number
remove section number
update table of content

1.2. 标题

Use the Find All References (Shift+Alt+F12) command to find all locations in the current workspace where a Markdown header or link is referenced:

1.2.1. asdfs asdf

Tired of accidentally breaking links when you change a Markdown header? Try using Rename Symbol (F2) instead. After you type the new header name and press Enter, VS Code will update the header as well as automatically updating all links to that header:

1.2.2. adsff

1.3. 段落文本 asdf

Smart selection uses the following commands:

  • Expand: Shift+Alt+Right
  • Shrink: Shift+Alt+Left

ctrl + b
ctrl + i
alt + s

helloasfd

hhadslfjo

I need <mark>to highl</mark>ight these ==very important words==.

hellow his is something,asdfasdflj asdflj asdflj adswflj asdf asdf lasdfj

asdf,aswdf asdfolj asdf
asdf
aasdf
hello asdfh asdhf
helloagfasdf,
hello asdf asdf.
a asdfqo weasdf

To create paragraphs, use a blank line to separate one or more lines of text.

asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas
,asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas ,asdf asdflj asldfj ldfjas ,
asdf.

asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf

  hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo hello helo

  中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文

1.4. code blocks

Unless the paragraph is in a list, don’t indent paragraphs with spaces or tabs.

中文阿斯蒂芬 阿三地方了 orgies

中文阿斯蒂芬 阿三地方了 orgies

中文阿斯蒂芬 阿三地方了 orgies

中文阿斯蒂芬 阿三地方了orgies

Code blocks are normally indented four spaces or one tab. When they’re in a list, indent them eight spaces or two tabs.

<html>
  <head>
    <title>Test</title>
  </head>

To denote a word or phrase as code, enclose it in backticks (`).

At the command prompt, type nano wesfdal sdaf asdf fas.

Fenced Code Blocks

1
2
3
4
5
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}
> To fix violations of this rule, use a consistent style (either indenting or code fences).
1
2
3
4
5
{
"firstName": "John",
"lastName": "Smith",
"age": 25
}

1.5. 列表

Unless the paragraph is in a list, don’t indent paragraphs with spaces or tabs.

To add another element in a list while preserving the continuity of the list, indent the element four spaces or one tab, as shown in the following examples.

  1. asdf

  2. asdf

  3. asdf

    1. asdf
      helo asdf asdfl asdflj asdfl j asdflj asdfl j lasdfj asdf asdfl asdflj asdfl j asdflj asdfl j lasdfj asdf asdfl asdflj asdfl j asdflj asdfl j lasdfj asdf asdfl asdflj asdfl j asdflj asdfl j lasdfj

    2. asdf,

      dsf asdfl asdfl lasdfj

  4. asdf

  • hello
  • world
    • ni hao
    • ni hao
    • nihao
  • nihao
  1. asdf
  2. asdf
    1. asdf
    2. asdfv
  3. asdf

  1. asdfa asg

    asdf asdf asdf

  2. asdf asdf asdf asdf

anotthre table

  1. asdf asdfl asdfl

  2. asdf asdf asdf asdf

    1. asdf asf asdf asdf

    2. asdf asdf

      asdf asdf

  3. asdf asdf asdf asdf


  1. hehloo asdf
  2. asdf asdf
    1. asdf asdf asdf
    2. asdf asdf asdf
      • sdf asdf sdaf
      • asdf asdf asdf
      • asdf asdf dfas
  3. asdf asdf asdf
  • hehehe
  • aoefqwfh

  • asdf

  • asdf

    • asdf

    • asdf asdgv

      asdf asdf asdfa sdaf asdf

      asdf asdf asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd asdfa sdaf asd

  • asdf qwrg asdgf


  • Write the press release
  • Update the website
  • Contact the media

1.6. quote 引用

asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf lol
asdf
asdf


For compatibility, put blank lines before and after blockquotes.

asdfhk asdf asdf asdf asdf asdf .

asdf asdf asdf

asdf

asdf

asdfh asdf


liucf2010@sina.com

https://www.baidu.com

http://www.example.com

My favorite sarch engine is Duck Duck go.

My favorite search engine is Duck Duck Go.

image

Path completions
Path completions help with create links to files and images. These paths are shown automatically by IntelliSense as you type the path of an image or link, and can also be manually requested by using Ctrl+Space.
Paths starting with / are resolved relative to the current workspace root, while paths staring with ./ or without any prefix are resolved relative to the current file. Path suggestions are automatically shown when you type / or can be manually invoked by using Ctrl+Space.

Tux, the Linux mascot

To add a link to an image, enclose the Markdown for the image in brackets, and then add the link in parentheses.

An old rock in the desert

You can Drag and drop a file from VS Code’s Explorer or from your operating system into a Markdown editor. Start by dragging a file from VS Code’s Explorer over your Markdown code and then hold down Shift to start dropping it into the file.

Title

If you prefer using the keyboard, you can also Copy and paste a file or image data into a Markdown editor.

With automatic Markdown link updating, VS Code will automatically update Markdown links whenever a linked to file is moved or renamed. You can enable this feature with the markdown.updateLinksOnFileMove.enabled setting.


Path IntelliSense can also help you link to headers within the current file or within another Markdown file. Start the path with # to see completions for all the headers in the file (depending on your settings, you may need to use Ctrl+Space to see these):

asdf

Accept one of these completions to insert the full link to that header, even if it’s in another file:

sdafqg

I love supporting the EFF.
This is the Markdown Guide.
See the section on code.

tishi hobbit-hole

In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends
of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to
eat: it was a hobbit-hole, and that means comfort.

link

<a href="https://www.example.com/my great page">link</a>

Footnotes

Here’s a simple footnote,[^1] and here’s a longer one.[^bignote]

[^1]: This is the first footnote.
[^bignote]: Here’s one with multiple paragraphs and code.

Indent paragraphs to include them in the footnote.

`{ my code }`

Add as many paragraphs as you like.

1.8. table 表格

left center right
1 2 3
45 768 987

Depending on the age of your hardware, you should have a choice of one or more of the following options, listed in order of preference:
● Wi-Fi Protected Access 2 (WPA2). Based on the 802.11i standard, WPA2 provides the
strongest protection for consumer-grade wireless networks. It uses 802.1x-based authentication and Advanced Encryption Standard (AES) encryption; combined, these technologies ensure that only authorized users can access the network and that any intercepted
data cannot be deciphered. WPA2 comes in two flavors: WPA2-Personal and WPA2-Enterprise. WPA2-Personal uses a passphrase to create its encryption keys and is currently the
best available security for wireless networks in homes and small offices. WPA2-Enterprise
requires a server to verify network users. All wireless products sold since early 2006 must
support WPA2 to bear the Wi-Fi CERTIFIED label.
● Wi-Fi Protected Access (WPA). WPA is an earlier version of the encryption scheme
that has since been replaced by WPA2. It was specifically designed to overcome weaknesses of WEP. On a small network that uses WPA, clients and access points use a shared
network password (called a preshared key, or PSK) that consists of a 256-bit number or
a passphrase that is from 8 to 63 bytes long. (A longer passphrase produces a stronger
key.) With a sufficiently strong key based on a truly random sequence, the likelihood of a
successful outside attack is slim. Most modern network hardware supports WPA only for
backward compatibility.
● Wired Equivalent Privacy (WEP). WEP is a first-generation scheme that dates back
before the turn of the century. It suffers from serious security flaws that make it inappropriate for use on any network that contains sensitive data. Most modern Wi-Fi equipment
supports WEP for backward compatibility with older hardware, but we strongly advise
against using it unless no other options are available.

国内公共DNS DoH/DoT/DoQ

DOT

DNS over TLS (DoT) is a network security protocol for encrypting and wrapping Domain Name System (DNS) queries and answers via the Transport Layer Security (TLS) protocol.

IP V4

1.1 腾讯 DNS
腾讯 DNS 基于 BGP Anycast 技术,不论用户身在何地,都可就近访问服务。支持谷歌 ECS 协议,配合 DNSPod 权威解析,可以给用户提供出最准确的解析结果,承诺不劫持解析结果。

IPv4:119.29.29.29
DoH:https://doh.pub/dns-query
DoH:https://1.12.12.12/dns-query
DoH:https://120.53.53.53/dns-query
DoH:https://sm2.doh.pub/dns-query (国密)
DoT:dot.pub
DoT:1.12.12.12
DoT:120.53.53.53
1.2 阿里 DNS
阿里 DNS 线路支持包括电信、移动、联通、鹏博士、广电网、教育网及海外 150 个国家或地域,支持用户 ECS 扩展技术,智能解析;支持 DoT/DoH 协议,保护用户隐私,安全防劫持。

IPv4:223.5.5.5
IPv4:223.6.6.6
DoH:https://223.5.5.5/dns-query
DoH:https://223.6.6.6/dns-query
DoH:https://dns.alidns.com/dns-query
DoT:dns.alidns.com

国内 IPv6 DNS

下一代互联网国家工程中心 IPv6 DNS
下一代互联网国家工程中心(CFIEC),由北京市发改委于 2012 年认定的北京市工程研究中心,并于 2015 年由国家发改委批复升级为国家地方联合工程研究中心。

IPv6:240C::6666
IPv6:240C::6644
DoT:dns.ipv6dns.com
DoH:https://dns.ipv6dns.com/dns-query
DNS64:240c::64 #纯 IPv6 访问 IPv4,需同时具备 DNS64 和 NAT64 服务可以
阿里云 IPv6 DNS
IPv6:2400:3200::1
IPv6:2400:3200:baba::1
DoH:https://2400:3200::1/dns-query
DoH:https://2400:3200:baba::1/dns-query
红鱼 rubyfish IPv6 DNS
DoT:v6.rubyfish.cn
DoH:https://v6.rubyfish.cn/dns-query
腾讯 IPv6 DNS
2402:4e00::

git wiki

alt text

alt text

alt text

alt text

alt text

git config –global http.proxy 127.0.0.1:10809
git config –global https.proxy 127.0.0.1:10809

git config –global http.sslVerify “false”

Alt text

Commits are shown in green as 5-character IDs, and they point to their parents. Branches are shown in orange, and they point to particular commits. The current branch is identified by the special reference HEAD, which is “attached” to that branch. In this image, the five latest commits are shown, with ed489 being the most recent. main (the current branch) points to this commit, while stable (another branch) points to an ancestor of main’s commit.

How does Git know what branch you’re currently on? It keeps a special pointer called HEAD.

git basic

Typically, you’ll want to start making changes and committing snapshots of those changes into your repository each time the project reaches a state you want to record.

each file in your working directory can be in one of two states: tracked or untracked.

Tracked files are files that were in the last snapshot, as well as any newly staged files; they can be unmodified, modified, or staged.In short, tracked files are files that Git knows about.

Untracked files are everything else — any files in your working directory that were not in your last snapshot and are not in your staging area. When you first clone a repository, all of your files will be tracked and unmodified because Git just checked them out and you haven’t edited anything.

As you edit files, Git sees them as modified, because you’ve changed them since your last commit. As you work, you selectively stage these modified files and then commit all those staged changes, and the cycle repeats.

Alt text

  • Checking the Status of Your Files
    The main tool you use to determine which files are in which state is the git status command. If you run this command directly after a clone, you should see something like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)

Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: _posts/category level1/category level2/git wiki.md

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: _posts/category level1/category level2/temp002.md

Untracked files:
(use "git add <file>..." to include in what will be committed)
assets/images/git wiki/
  • Tracking New Files
    In order to begin tracking a new file, you use the command git add. To begin tracking the README file, you can run this:

$ git add README

  • Staging Modified Files

“Changes not staged for commit” — which means that a file that is tracked has been modified in the working directory but not yet staged. To stage it, you run the git add command.

git add is a multipurpose command — you use it to begin tracking new files, to stage files, and to do other things like marking merge-conflicted files as resolved. It may be helpful to think of it more as “add precisely this content to the next commit” rather than “add this file to the project”.

Git stages a file exactly as it is when you run the git add command. If you commit now, the version of CONTRIBUTING.md as it was when you last ran the git add command is how it will go into the commit, not the version of the file as it looks in your working directory when you run git commit. If you modify a file after you run git add, you have to run git add again to stage the latest version of the file:

  • Ignoring Files
    Often, you’ll have a class of files that you don’t want Git to automatically add or even show you as being untracked. These are generally automatically generated files such as log files or files produced by your build system. In such cases, you can create a file listing patterns to match them named .gitignore.

Setting up a .gitignore file for your new repository before you get going is generally a good idea so you don’t accidentally commit files that you really don’t want in your Git repository.


The rules for the patterns you can put in the .gitignore file are as follows:

Blank lines or lines starting with # are ignored.

Standard glob patterns work, and will be applied recursively throughout the entire working tree.

You can start patterns with a forward slash / to avoid recursivity.

You can end patterns with a forward slash / to specify a directory.

You can negate a pattern by starting it with an exclamation point !.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# ignore all .a files
*.a

# but do track lib.a, even though you're ignoring .a files above
!lib.a

# only ignore the TODO file in the current directory, not subdir/TODO
/TODO

# ignore all files in any directory named build
build/

# ignore doc/notes.txt, but not doc/server/arch.txt
doc/*.txt

# ignore all .pdf files in the doc/ directory and any of its subdirectories
doc/**/*.pdf
  • Viewing Your Staged and Unstaged Changes
    If the git status command is too vague for you — you want to know exactly what you changed, not just which files were changed — you can use the git diff command.

  • Committing Your Changes
    Now that your staging area is set up the way you want it, you can commit your changes. Remember that anything that is still unstaged — any files you have created or modified that you haven’t run git add on since you edited them — won’t go into this commit. They will stay as modified files on your disk.

Alternatively, you can type your commit message inline with the commit command by specifying it after a -m flag, like this:

$ git commit -m "Story 182: fix benchmarks for speed"

  • Removing Files
    To remove a file from Git, you have to remove it from your tracked files (more accurately, remove it from your staging area) and then commit. The git rm command does that, and also removes the file from your working directory so you don’t see it as an untracked file the next time around.

If you simply remove the file from your working directory, it shows up under the “Changes not staged for commit”

Then, if you run git rm, it stages the file’s removal:


Another useful thing you may want to do is to keep the file in your working tree but remove it from your staging area. In other words, you may want to keep the file on your hard drive but not have Git track it anymore. This is particularly useful if you forgot to add something to your .gitignore file and accidentally staged it, like a large log file or a bunch of .a compiled files. To do this, use the –cached option:

$ git rm --cached README

You can pass files, directories, and file-glob patterns to the git rm command. That means you can do things such as:

$ git rm log/\*.log

Note the backslash \ in front of the *. This is necessary because Git does its own filename expansion in addition to your shell’s filename expansion. This command removes all files that have the .log extension in the log/ directory.

  • If you rename a file in Git, no metadata is stored in Git that tells it you renamed the file. However, Git is pretty smart about figuring that out after the fact

$ git mv file_from file_to

However, this is equivalent to running something like this:

$ mv README.md README
$ git rm README.md
$ git add README
Git figures out that it’s a rename implicitly, so it doesn’t matter if you rename a file that way or with the mv command.

you can use any tool you like to rename a file, and address the add/rm later, before you commit.

github git vsCode proxy setting

  1. vsCode setting

    1
    2
    3
    "http.proxyAuthorization": null,
    "http.proxy": "http://127.0.0.1:8000",
    "https.proxy": "http://127.0.0.1:8000"
  2. git bash command

    1
    2
    git config -global http.proxy http://127.0.0.1:8000
    git config -global https.proxy http://127.0.0.1:8000

basic commands

Alt text

  1. The four commands above copy files between the working directory, the stage (also called the index), and the history (in the form of commits).
  • git add files copies files (at their current state) to the stage.
  • git commit saves a snapshot of the stage as a commit.
  • git resetfiles unstages files; that is, it copies files from the latest commit to the stage. Use this command to “undo” a git add files. You can also git reset to unstage everything.
  • git checkout -- *files* copies files from the stage to the working directory. Use this to throw away local changes.

ou can use git reset -p, git checkout -p, or git add -p instead of (or in addition to) specifying particular files to interactively choose which hunks copy.

  1. It is also possible to jump over the stage and check out files directly from the history or commit files without staging first.

Alt text

  • git commit -a is equivalent to running git add on all filenames that existed in the latest commit, and then running git commit.
  • git commit *files* creates a new commit containing the contents of the latest commit, plus a snapshot of files taken from the working directory. Additionally, files are copied to the stage.
    git checkout HEAD -- *files* copies files from the latest commit to both the stage and the working directory.

git diff

There are various ways to look at differences between commits. Below are some common examples. Any of these commands can optionally take extra filename arguments that limit the differences to the named files.

Alt text

git commit

When you commit, git creates a new commit object using the files from the stage and sets the parent to the current commit. It then points the current branch to this new commit. In the image below, the current branch is main. Before the command was run, main pointed to ed489. Afterward, a new commit, f0cec, was created, with parent ed489, and then main was moved to the new commit.

Alt text

This same process happens even when the current branch is an ancestor of another. Below, a commit occurs on branch stable, which was an ancestor of main, resulting in 1800b. Afterward, stable is no longer an ancestor of main. To join the two histories, a merge (or rebase) will be necessary.

Alt text

Sometimes a mistake is made in a commit, but this is easy to correct with git commit –amend. When you use this command, git creates a new commit with the same parent as the current commit. (The old commit will be discarded if nothing else references it.)

Alt text

git branch

git branch name will create a new branch named “name”. Creating branches just creates a new tag pointing to the currently checked out commit.

git checkout

git checkout has many uses, but the main one is to switch between branches.
For example, to switch from master branch to dev branch, I would type git checkout dev.

The checkout command is used to copy files from the history (or stage) to the working directory, and to optionally switch branches.

  1. When a filename is not given but the reference is a (local) branch, HEAD is moved to that branch (that is, we “switch to” that branch), and then the stage and working directory are set to match the contents of that commit. Any file that exists in the new commit (a47c3 below) is copied; any file that exists in the old commit (ed489) but not in the new one is deleted; and any file that exists in neither is ignored.

Alt text

  1. When a filename is not given and the reference is not a (local) branch — say, it is a tag, a remote branch, a SHA-1 ID, or something like main~3 — we get an anonymous branch, called a detached HEAD. This is useful for jumping around the history. Say you want to compile version 1.6.6.1 of git. You can git checkout v1.6.6.1 (which is a tag, not a branch), compile, install, and then switch back to another branch, say git checkout main. However, committing works slightly differently with a detached HEAD; this is covered below.

Alt text

  1. When a filename (and/or -p) is given, git copies those files from the given commit to the stage and the working directory. For example, git checkout HEAD~ foo.c copies the file foo.c from the commit called HEAD~ (the parent of the current commit) to the working directory, and also stages it. (If no commit name is given, files are copied from the stage.) Note that the current branch is not changed.

Alt text

  1. When HEAD is detached, commits work like normal, except no named branch gets updated. (You can think of this as an anonymous branch.)

Alt text

Once you check out something else, say main, the commit is (presumably) no longer referenced by anything else, and gets lost. Note that after the command, there is nothing referencing 2eecb.

Alt text


In addition to checking out branches, you can also checkout individual commits.

git checkout bb92e0e
git commit
Not a good idea to make commits while in a detached HEAD state.

git checkout bb92e0e
git branch branchname1
git commit


You can combine git branch and git checkout into a single command by typing git checkout -b branchname. This will create the branch if it does not already exist and immediately check it out.when you commit, the HEAD is the new branch.

undo commit

git reset

git reset will move HEAD and the current branch back to wherever you specify, abandoning any commits that may be left behind. This is useful to undo a commit that you no longer need.

This command is normally used with one of three flags: “–soft”, “–mixed”, and “–hard”. The soft and mixed flags deal with what to do with the work that was inside the commit after you reset, and you can read about it here. Since this visualization cannot graphically display that work, only the “–hard” flag will work on this site.

The ref “HEAD^” is usually used together with this command. “HEAD^” means “the commit right before HEAD. “HEAD^^” means “two commits before HEAD”, and so on.

!!Note that you must never use git reset to abandon commits that have already been pushed and merged into the origin. This can cause your local repository to become out of sync with the origin. Don’t do it unless you really know what you’re doing.


The reset command moves the current branch to another position, and optionally updates the stage and the working directory. It also is used to copy files from the history to the stage without touching the working directory.

If a commit is given with no filenames, the current branch is moved to that commit, and then the stage is updated to match this commit. If –hard is given, the working directory is also updated. If –soft is given, neither is updated.

Alt text

If a commit is not given, it defaults to HEAD. In this case, the branch is not moved, but the stage (and optionally the working directory, if –hard is given) are reset to the contents of the last commit.

Alt text

git revert

To undo commits that have already been pushed and shared with the team, we cannot use the git reset command. Instead, we have to use git revert.

git revert will create a new commit that will undo all of the work that was done in the commit you want to revert.

Alt text

combine branches

git merge

git merge will create a new commit with two parents. The resulting commit snapshot will have the all of the work that has been done in both branches.

If there was no divergence between the two commits, git will do a “fast-forward” method merge.

A merge creates a new commit that incorporates changes from other commits. Before merging, the stage must match the current commit. The trivial case is if the other commit is an ancestor of the current commit, in which case nothing is done. The next most simple is if the current commit is an ancestor of the other commit. This results in a fast-forward merge. The reference is simply moved, and then the new commit is checked out.

Alt text

Otherwise, a “real” merge must occur. You can choose other strategies, but the default is to perform a “recursive” merge, which basically takes the current commit (ed489 below), the other commit (33104), and their common ancestor (b325c), and performs a three-way merge. The result is saved to the working directory and the stage, and then a commit occurs, with an extra parent (33104) for the new commit.

Alt text

“git merge” used to allow merging two branches that have no common base by default, which led to a brand new history of an existing project created and then get pulled by an unsuspecting maintainer, which allowed an unnecessary parallel history merged into the existing project. The command has been taught not to allow this by default, with an escape hatch –allow-unrelated-histories option to be used in a rare event that merges histories of two projects that started their lives independently.

git rebase

git rebase will take the commits on this branch and “move” them so that their new “base” is at the point you specify.

The reason I put “move” in quotations because this process actually generates brand new commits with completely different IDs than the old commits, and leaves the old commits where they were. For this reason, you never want to rebase commits that have already been shared with the team you are working with.

A rebase is an alternative to a merge for combining multiple branches. Whereas a merge creates a single commit with two parents, leaving a non-linear history, a rebase replays the commits from the current branch onto another, leaving a linear history. In essence, this is an automated way of performing several cherry-picks in a row.

Alt text

The above command takes all the commits that exist in topic but not in main (namely 169a6 and 2c33a), replays them onto main, and then moves the branch head to the new tip. Note that the old commits will be garbage collected if they are no longer referenced.

remote server

  • Showing Your Remotes
    To see which remote servers you have configured, you can run the git remote command. It lists the shortnames of each remote handle you’ve specified.

If you’ve cloned your repository, you should at least see origin — that is the default name Git gives to the server you cloned from:

1
2
3
4
5
6
7
8
9
10
$ git clone https://github.com/schacon/ticgit
Cloning into 'ticgit'...
remote: Reusing existing pack: 1857, done.
remote: Total 1857 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1857/1857), 374.35 KiB | 268.00 KiB/s, done.
Resolving deltas: 100% (772/772), done.
Checking connectivity... done.
$ cd ticgit
$ git remote
origin

You can also specify -v, which shows you the URLs that Git has stored for the shortname to be used when reading and writing to that remote:

$ git remote -v
origin https://github.com/schacon/ticgit (fetch)
origin https://github.com/schacon/ticgit (push)

  • Adding Remote Repositories
    We’ve mentioned and given some demonstrations of how the git clone command implicitly adds the origin remote for you. Here’s how to add a new remote explicitly. To add a new remote Git repository as a shortname you can reference easily, run git remote add <shortname> <url>:
1
2
3
4
5
6
7
8
$ git remote
origin
$ git remote add pb https://github.com/paulboone/ticgit
$ git remote -v
origin https://github.com/schacon/ticgit (fetch)
origin https://github.com/schacon/ticgit (push)
pb https://github.com/paulboone/ticgit (fetch)
pb https://github.com/paulboone/ticgit (push)

if you want to fetch all the information that Paul has but that you don’t yet have in your repository, you can run git fetch pb:

1
2
3
4
5
6
7
8
 $ git fetch pb
remote: Counting objects: 43, done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 43 (delta 10), reused 31 (delta 5)
Unpacking objects: 100% (43/43), done.
From https://github.com/paulboone/ticgit
* [new branch] master -> pb/master
* [new branch] ticgit -> pb/ticgit

Paul’s master branch is now accessible locally as pb/master — you can merge it into one of your branches, or you can check out a local branch at that point if you want to inspect it.

git fetch

As you just saw, to get data from your remote projects, you can run:

$ git fetch <remote>

git fetch will update all of the “remote tracking branches” in your local repository. Remote tracking branches are tagged in grey.

It’s important to note that the git fetch command only downloads the data to your local repository — it doesn’t automatically merge it with any of your work or modify what you’re currently working on. You have to merge it manually into your work when you’re ready.

Alt text

Alt text

git pull

A git pull is a two step process that first does a git fetch, and then does a git merge of the remote tracking branch associated with your current branch. If you have no current branch, the process will stop after fetching.

If your current branch is set up to track a remote branch, you can use the git pull command to automatically fetch and then merge that remote branch into your current branch.

If you have a tracking branch set up as demonstrated in the last section, either by explicitly setting it or by having it created for you by the clone or checkout commands, git pull will look up what server and branch your current branch is tracking, fetch from that server and then try to merge in that remote branch.


Tracking branches are local branches that have a direct relationship to a remote branch. If you’re on a tracking branch and type git pull, Git automatically knows which server to fetch from and which branch to merge in.

If you clone a repository, the command automatically adds that remote repository under the name “origin”

by default, the git clone command automatically sets up your local master branch to track the remote master branch (or whatever the default branch is called)

you can set up other tracking branches if you wish — ones that track branches on other remotes, or don’t track the master branch. The simple case is the example you just saw, running git checkout -b <branch> <remote>/<branch>.

$ git checkout -b sf origin/serverfix

Branch sf set up to track remote branch serverfix from origin.
Switched to a new branch ‘sf’
Now, your local branch sf will automatically pull from origin/serverfix.

If you already have a local branch and want to set it to a remote branch you just pulled down, or want to change the upstream branch you’re tracking, you can use the -u or --set-upstream-to option to git branch to explicitly set it at any time.

$ git branch -u origin/serverfix

Branch serverfix set up to track remote branch serverfix from origin.

If you want to see what tracking branches you have set up, you can use the -vv option to git branch. This will list out your local branches with more information including what each branch is tracking and if your local branch is ahead, behind or both.

1
2
3
4
5
6
7
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
1
2
3
4
$ git push
fatal: The current branch newbrachname has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin newbrachname
1
2
3
4
5
$ git branch -vv
iss53 7e424c3 [origin/iss53: ahead 2] Add forgotten brackets
master 1ae2a45 [origin/master] Deploy index fix
* serverfix f8674d9 [teamone/server-fix-good: ahead 3, behind 1] This should do it
testing 5ea463a Try something new

So here we can see that our iss53 branch is tracking origin/iss53 and is “ahead” by two, meaning that we have two commits locally that are not pushed to the server.
We can also see that our master branch is tracking origin/master and is up to date.
Next we can see that our serverfix branch is tracking the server-fix-good branch on our teamone server and is ahead by three and behind by one, meaning that there is one commit on the server we haven’t merged in yet and three commits locally that we haven’t pushed.
Finally we can see that our testing branch is not tracking any remote branch.

It’s important to note that these numbers are only since the last time you fetched from each server. This command does not reach out to the servers, it’s telling you about what it has cached from these servers locally. If you want totally up to date ahead and behind numbers, you’ll need to fetch from all your remotes right before running this. You could do that like this:

$ git fetch --all; git branch -vv

git push

A git push will find the commits you have on your local branch that the corresponding branch on the origin server does not have, and send them to the remote repository.

By default, all pushes must cause a fast-forward merge on the remote repository. If there is any divergence between your local branch and the remote branch, your push will be rejected. In this scenario, you need to pull first and then you will be able to push again.

If you have a branch named serverfix that you want to work on with others, you can push it up the same way you pushed your first branch. Run git push <remote> <branch>:

$ git push origin serverfix

You can also do git push origin serverfix:serverfix, which does the same thing — it says, “Take my serverfix and make it the remote’s serverfix.” You can use this format to push a local branch into a remote branch that is named differently. If you didn’t want it to be called serverfix on the remote, you could instead run git push origin serverfix:awesomebranch to push your local serverfix branch to the awesomebranch branch on the remote project.

example

you have a Git server on your network at git.ourcompany.com. If you clone from this, Git’s clone command automatically names it origin for you, pulls down all its data, creates a pointer to where its master branch is, and names it origin/master locally. Git also gives you your own local master branch starting at the same place as origin’s master branch, so you have something to work from.

Alt text

If you do some work on your local master branch, and, in the meantime, someone else pushes to git.ourcompany.com and updates its master branch, then your histories move forward differently. Also, as long as you stay out of contact with your origin server, your origin/master pointer doesn’t move.

Alt text

To synchronize your work with a given remote, you run a git fetch <remote> command (in our case, git fetch origin). This command looks up which server “origin” is (in this case, it’s git.ourcompany.com), fetches any data from it that you don’t yet have, and updates your local database, moving your origin/master pointer to its new, more up-to-date position.

Alt text

you have another internal Git server that is used only for development by one of your sprint teams. This server is at git.team1.ourcompany.com. You can add it as a new remote reference to the project you’re currently working on by running the git remote add command.Name this remote teamone, which will be your shortname for that whole URL.

Alt text

Now, you can run git fetch teamone to fetch everything the remote teamone server has that you don’t have yet. Because that server has a subset of the data your origin server has right now, Git fetches no data but sets a remote-tracking branch called teamone/master to point to the commit that teamone has as its master branch.

Alt text

It’s important to note that when you do a fetch that brings down new remote-tracking branches, you don’t automatically have local, editable copies of them. In other words, in this case, you don’t have a new serverfix branch — you have only an origin/serverfix pointer that you can’t modify.

To merge this work into your current working branch, you can run git merge origin/serverfix.

If you want your own serverfix branch that you can work on, you can base it off your remote-tracking branch:

$ git checkout -b serverfix origin/serverfix
Branch serverfix set up to track remote branch serverfix from origin.
Switched to a new branch ‘serverfix’
This gives you a local branch that you can work on that starts where origin/serverfix is.

  • How to create a new repository which is a clone of another repository
  1. There’s probably several ways to do this, including a smarter one, but this is how I would do this:

Make a new repo on Github called SecondProject.
Locally clone your MyfirstProject, either from disk or from Github. Then use git pull on the branches you need to move to the second repo.

git remote set-url origin git@github.com:yourname/SecondProject.git

Push it.
Note that the clone retains a shared history with MyfirstProject, which is useful if you change your mind about the “never merge” bit.

2

Clone your MyfirstProject to your local machine.
Delete .git folder
git init
Publish your new project

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test (newbrachname)
$ cd ../test1



lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1
$ git clone git@github.com:lucfe2010/images-1.git
Cloning into 'images-1'...
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 13 (delta 2), reused 9 (delta 2), pack-reused 0
Receiving objects: 100% (13/13), 160.86 KiB | 285.00 KiB/s, done.
Resolving deltas: 100% (2/2), done.

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1
$ cd images-1/

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git remote -v
origin git@github.com:lucfe2010/images-1.git (fetch)
origin git@github.com:lucfe2010/images-1.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git branch -vv
* master 0a5aeaa [origin/master] Upload by PicGo

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git remote remove origin

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git remote -v

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git branch -vv
* master 0a5aeaa Upload by PicGo

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git remote add origin git@github.com:lucfe2010/test.git

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git remote -v
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git branch -v
* master 0a5aeaa Upload by PicGo

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.


lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git push -u origin master
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote: https://github.com/lucfe2010/test/pull/new/master
remote:
To github.com:lucfe2010/test.git
* [new branch] master -> master
branch 'master' set up to track 'origin/master'.

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git remote -v
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test1/images-1 (master)
$ git branch -vv
* master 0a5aeaa [origin/master] Upload by PicGo


---


lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1
$ cd test3

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3
$ git clone git@github.com:lucfe2010/test.git
Cloning into 'test'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 11 (delta 2), reused 11 (delta 2), pack-reused 0
Receiving objects: 100% (11/11), 160.61 KiB | 309.00 KiB/s, done.
Resolving deltas: 100% (2/2), done.

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3
$ git remote -v
fatal: not a git repository (or any of the parent directories): .git

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3
$ cd test

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3/test (newbrachname)
$ git remote -v
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3/test (newbrachname)
$ git branch -vv
* newbrachname 6c2d445 [origin/newbrachname] 4253

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3/test (newbrachname)
$ git remote set-url origin git@github.com:lucfe2010/images-1.git

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3/test (newbrachname)
$ git remote -v
origin git@github.com:lucfe2010/images-1.git (fetch)
origin git@github.com:lucfe2010/images-1.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3/test (newbrachname)
$ git branch -vv
* newbrachname 6c2d445 [origin/newbrachname] 4253

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test3/test (newbrachname)
$ git push
Everything up-to-date


---

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4
$ git clone git@github.com:lucfe2010/test.git
Cloning into 'test'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 11 (delta 2), reused 11 (delta 2), pack-reused 0
Receiving objects: 100% (11/11), 160.61 KiB | 261.00 KiB/s, done.

Resolving deltas: 100% (2/2), done.

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4
$ cd test

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (newbrachname)
$ git remote -v
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (newbrachname)
$ git branch -vv
* newbrachname 6c2d445 [origin/newbrachname] 4253

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (newbrachname)
$ git remote add myrepo git@github.com:lucfe2010/images-1.git

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (newbrachname)
$ git remote -v
myrepo git@github.com:lucfe2010/images-1.git (fetch)
myrepo git@github.com:lucfe2010/images-1.git (push)
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (newbrachname)
$ git branch -vv
* newbrachname 6c2d445 [origin/newbrachname] 4253

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (newbrachname)
$ git branch myb

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (newbrachname)
$ git checkout myb
Switched to branch 'myb'

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (myb)
$ git fetch myrepo
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 56.66 KiB | 118.00 KiB/s, done.
From github.com:lucfe2010/images-1
* [new branch] main -> myrepo/main
* [new branch] master -> myrepo/master
* [new branch] myb -> myrepo/myb
* [new branch] newbrachname -> myrepo/newbrachname


lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (myb)
$ git branch -u myrepo/myb
branch 'myb' set up to track 'myrepo/myb'.

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (myb)
$ git branch -vv
* myb 6c2d445 [myrepo/myb] 4253
newbrachname 6c2d445 [origin/newbrachname] 4253


lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test4/test (myb)
$ git pull
Already up to date.

---

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5
$ git clone git@github.com:lucfe2010/test.git
Cloning into 'test'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 11 (delta 2), reused 11 (delta 2), pack-reused 0
Receiving objects: 100% (11/11), 160.61 KiB | 302.00 KiB/s, done.

Resolving deltas: 100% (2/2), done.

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5
$ cd test

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (newbrachname)
$ git remote -v
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (newbrachname)
$ git branch -v
* newbrachname 6c2d445 4253

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (newbrachname)
$ git remote add myrepo git@github.com:lucfe2010/images-1.git

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (newbrachname)
$ git remote -v
myrepo git@github.com:lucfe2010/images-1.git (fetch)
myrepo git@github.com:lucfe2010/images-1.git (push)
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (newbrachname)
$ git fetch myrepo
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), 56.66 KiB | 118.00 KiB/s, done.
From github.com:lucfe2010/images-1
* [new branch] main -> myrepo/main
* [new branch] master -> myrepo/master
* [new branch] myb -> myrepo/myb
* [new branch] newbrachname -> myrepo/newbrachname

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (newbrachname)
$ git checkout -b myb myrepo/myb
Switched to a new branch 'myb'
branch 'myb' set up to track 'myrepo/myb'.

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (myb)
$ git branch -vv
* myb 6c2d445 [myrepo/myb] 4253
newbrachname 6c2d445 [origin/newbrachname] 4253

lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (myb)
$ git remote -v
myrepo git@github.com:lucfe2010/images-1.git (fetch)
myrepo git@github.com:lucfe2010/images-1.git (push)
origin git@github.com:lucfe2010/test.git (fetch)
origin git@github.com:lucfe2010/test.git (push)



lcf@DESKTOP-LCF MINGW64 ~/Documents/lucfe_website_test/test_git_1/test1/test5/test (myb)
$ git pull
Already up to date.

sql-complete-developers-guide-mysql-postgresql

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

oracle安装教程

网格安装选项。选择“单实例数据库安装”,如下图所示,单击下一步。

Alt text

安装类型。选择“高级安装”,如下图所示,单击下一步。
Alt text

产品语言。直接默认即可(简体中文、英语),如下图所示,单击下一步。

Alt text

数据库版本。选择“企业版”,如下图所示,单击下一步。

Alt text

安装位置。填入安装路径(只需要填“Oracle基目录”即可,“软件位置”会自动生成),如下图所示,单击下一步。
Alt text

配置类型。选择“一般用途/事务处理”,如下图所示,单击下一步。

Alt text

数据库标识符。填入全局数据库名和SID,如下图所示,单击下一步。

Alt text

配置选项。切换到“字符集”选项卡,选择“使用Unicode(AL32UTF8)”,如下图所示,单击下一步。

Alt text

管理选项。直接单击下一步,即选择“Database Control”如下图所示。

Alt text

数据库存储。直接单击下一步,即选择“文件系统”如下图所示。

Alt text

方案口令。为了便于测试,这里使用了相同的密码,实际部署时可根据实际情况自行决定。

Alt text

Alt text

摄像头

計算攝影(Computational Photography)是指利用數字運算而非採用傳統的光學過程的數字圖像拍攝。計算攝影可以提高相機的性能,可具備膠捲相機所不具備的特性,也可以減少相機模組的成本和尺寸;常見的數碼全景功能所需的機內計算,HDR圖像、利用光學組件的光場(light field)相機捕捉的立體場景信息(Scene Information)生成3D圖像、景深的增強和選擇性的散焦(Post Focus)都歸屬於計算攝影。

光場是用來描述通過空間中每一個點和每一個方向的光的量的一個函數。麥可·法拉第首先提出光應被理解為一個場(1846年的演講題為《光線振動思考(Thoughts on Ray Vibrations)》),就像磁場一樣。

潜望式镜头

物体离得近,就需要短焦距的镜头成像;物体离得远,就需要长焦距的镜头成像,才能使得同样一个物理拍出同样的大小。
要想拍清楚远处的东西,就需要长焦距。

不一定非得装两块反光镜,如果装一个反光棱镜,传感器的位置相应的调整即可。

Alt text