效率工具

1. 添加环境变量

[Environment]::SetEnvironmentVariable("EDITOR", "code --wait", "User")

2. windows命令行代理

set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080

3. git代理

# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy

也可以直接编辑~/.gitconfig文件

4. windows配置beyondcompare作为gitdiff

修改.gitconfig配置文件

[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool "bc4"]
    cmd = "\"D:/Beyond Compare/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"" 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool "bc4"] 
    cmd = "\"D:/Beyond Compare/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"" 
    trustExitCode = true

5. 删除重复文件

# 预览模式
Get-ChildItem -Path "D:\document" -File -Recurse | Where-Object {$_.BaseName -match '^.+ \d{1,2}<h1 id="1-添加环境变量">1. 添加环境变量</h1>
<pre><code class="language-shell">[Environment]::SetEnvironmentVariable(&quot;EDITOR&quot;, &quot;code --wait&quot;, &quot;User&quot;)
</code></pre>
<h1 id="2-windows命令行代理">2. windows命令行代理</h1>
<pre><code class="language-dos">set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
</code></pre>
<h1 id="3-git代理">3. git代理</h1>
<pre><code class="language-dos"># 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
</code></pre>
<p>也可以直接编辑~/.gitconfig文件</p>
<h1 id="4-windows配置beyondcompare作为gitdiff">4. windows配置beyondcompare作为gitdiff</h1>
<p>修改.gitconfig配置文件</p>
<pre><code class="language-text">[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &quot;bc4&quot;]
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot;&quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &quot;bc4&quot;] 
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot; \&quot;$BASE\&quot; \&quot;$MERGED\&quot;&quot; 
    trustExitCode = true
</code></pre>
<h1 id="5-删除重复文件">5. 删除重复文件</h1>
<pre><code class="language-poweshell"># 预览模式
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}<div class="article-page-layout">
    <div class="article-main-column">
        <article>
            <header>
                <div class="article-header-wrapper">
                    <h1>效率工具</h1>
                    <div class="article-header-actions">
                        <button type="button"
                                class="article-presenter-btn"
                                data-presenter-toggle
                                title="Presenter mode"
                                aria-label="Open presenter mode">
                            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <rect x="2" y="4" width="20" height="14" rx="2"></rect>
                                <path d="M8 20h8"></path>
                                <path d="M12 18v2"></path>
                            </svg>
                            <span>Presenter</span>
                        </button>
                        <a href="assets/markdown/效率工具.md"
                           download="效率工具.md"
                           class="markdown-export-btn"
                           title="Download Markdown source"
                           aria-label="Export Markdown">
                            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                                <polyline points="7 10 12 15 17 10"></polyline>
                                <line x1="12" y1="15" x2="12" y2="3"></line>
                            </svg>
                        </a>
                    </div>
                </div>
                <time datetime="2025-09-17T13:31:12.000Z">2025年9月17日</time>
                <div class="tags">
                    
                </div>
            </header>
            <section class="content">
                <h1 id="1-添加环境变量">1. 添加环境变量</h1>
<pre><code class="language-shell">[Environment]::SetEnvironmentVariable(&quot;EDITOR&quot;, &quot;code --wait&quot;, &quot;User&quot;)
</code></pre>
<h1 id="2-windows命令行代理">2. windows命令行代理</h1>
<pre><code class="language-dos">set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
</code></pre>
<h1 id="3-git代理">3. git代理</h1>
<pre><code class="language-dos"># 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
</code></pre>
<p>也可以直接编辑~/.gitconfig文件</p>
<h1 id="4-windows配置beyondcompare作为gitdiff">4. windows配置beyondcompare作为gitdiff</h1>
<p>修改.gitconfig配置文件</p>
<pre><code class="language-text">[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &quot;bc4&quot;]
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot;&quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &quot;bc4&quot;] 
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot; \&quot;$BASE\&quot; \&quot;$MERGED\&quot;&quot; 
    trustExitCode = true
</code></pre>
<h1 id="5-删除重复文件">5. 删除重复文件</h1>
<pre><code class="language-poweshell"># 预览模式
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Remove-Item -Force
</code></pre>

            </section>
        </article>

        
        <section class="comments-section" id="comments">
            <h2 class="comments-title">评论</h2>
            <div class="utterances-container">
                <script src="https://utteranc.es/client.js"
        repo="shinerio/shinerio.github.io"
        issue-term="效率工具"
        label="blog-comment"
        theme="preferred-color-scheme"
        crossorigin="anonymous"
        async>
</script>
            </div>
        </section>
        
    </div>

    
    <aside class="article-toc-sidebar" data-presenter-toc-source aria-label="Table of contents">
        <div class="article-toc-card">
            <h2 class="article-toc-title">目录</h2>
            <nav class="article-toc-nav">
                <ul class="toc-list"><li class="toc-level-1"><a href="#1-添加环境变量" class="toc-link">1. 添加环境变量</a></li><li class="toc-level-1"><a href="#2-windows命令行代理" class="toc-link">2. windows命令行代理</a></li><li class="toc-level-1"><a href="#3-git代理" class="toc-link">3. git代理</a></li><li class="toc-level-1"><a href="#4-windows配置beyondcompare作为gitdiff" class="toc-link">4. windows配置beyondcompare作为gitdiff</a></li><li class="toc-level-1"><a href="#5-删除重复文件" class="toc-link">5. 删除重复文件</a></li></ul>
            </nav>
        </div>
    </aside>
    
</div>amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}<div class="article-page-layout">
    <div class="article-main-column">
        <article>
            <header>
                <div class="article-header-wrapper">
                    <h1>效率工具</h1>
                    <div class="article-header-actions">
                        <button type="button"
                                class="article-presenter-btn"
                                data-presenter-toggle
                                title="Presenter mode"
                                aria-label="Open presenter mode">
                            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <rect x="2" y="4" width="20" height="14" rx="2"></rect>
                                <path d="M8 20h8"></path>
                                <path d="M12 18v2"></path>
                            </svg>
                            <span>Presenter</span>
                        </button>
                        <a href="assets/markdown/效率工具.md"
                           download="效率工具.md"
                           class="markdown-export-btn"
                           title="Download Markdown source"
                           aria-label="Export Markdown">
                            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                                <polyline points="7 10 12 15 17 10"></polyline>
                                <line x1="12" y1="15" x2="12" y2="3"></line>
                            </svg>
                        </a>
                    </div>
                </div>
                <time datetime="2025-09-17T13:31:12.000Z">2025年9月17日</time>
                <div class="tags">
                    
                </div>
            </header>
            <section class="content">
                <h1 id="1-添加环境变量">1. 添加环境变量</h1>
<pre><code class="language-shell">[Environment]::SetEnvironmentVariable(&quot;EDITOR&quot;, &quot;code --wait&quot;, &quot;User&quot;)
</code></pre>
<h1 id="2-windows命令行代理">2. windows命令行代理</h1>
<pre><code class="language-dos">set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
</code></pre>
<h1 id="3-git代理">3. git代理</h1>
<pre><code class="language-dos"># 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
</code></pre>
<p>也可以直接编辑~/.gitconfig文件</p>
<h1 id="4-windows配置beyondcompare作为gitdiff">4. windows配置beyondcompare作为gitdiff</h1>
<p>修改.gitconfig配置文件</p>
<pre><code class="language-text">[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &quot;bc4&quot;]
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot;&quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &quot;bc4&quot;] 
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot; \&quot;$BASE\&quot; \&quot;$MERGED\&quot;&quot; 
    trustExitCode = true
</code></pre>
<h1 id="5-删除重复文件">5. 删除重复文件</h1>
<pre><code class="language-poweshell"># 预览模式
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Remove-Item -Force
</code></pre>

            </section>
        </article>

        
        <section class="comments-section" id="comments">
            <h2 class="comments-title">评论</h2>
            <div class="utterances-container">
                <script src="https://utteranc.es/client.js"
        repo="shinerio/shinerio.github.io"
        issue-term="效率工具"
        label="blog-comment"
        theme="preferred-color-scheme"
        crossorigin="anonymous"
        async>
</script>
            </div>
        </section>
        
    </div>

    
    <aside class="article-toc-sidebar" data-presenter-toc-source aria-label="Table of contents">
        <div class="article-toc-card">
            <h2 class="article-toc-title">目录</h2>
            <nav class="article-toc-nav">
                <ul class="toc-list"><li class="toc-level-1"><a href="#1-添加环境变量" class="toc-link">1. 添加环境变量</a></li><li class="toc-level-1"><a href="#2-windows命令行代理" class="toc-link">2. windows命令行代理</a></li><li class="toc-level-1"><a href="#3-git代理" class="toc-link">3. git代理</a></li><li class="toc-level-1"><a href="#4-windows配置beyondcompare作为gitdiff" class="toc-link">4. windows配置beyondcompare作为gitdiff</a></li><li class="toc-level-1"><a href="#5-删除重复文件" class="toc-link">5. 删除重复文件</a></li></ul>
            </nav>
        </div>
    </aside>
    
</div>amp;#39;} | Remove-Item -Force
</code></pre>
#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path "D:\document" -File -Recurse | Where-Object {$_.BaseName -match '^.+ \d{1,2}<h1 id="1-添加环境变量">1. 添加环境变量</h1>
<pre><code class="language-shell">[Environment]::SetEnvironmentVariable(&quot;EDITOR&quot;, &quot;code --wait&quot;, &quot;User&quot;)
</code></pre>
<h1 id="2-windows命令行代理">2. windows命令行代理</h1>
<pre><code class="language-dos">set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
</code></pre>
<h1 id="3-git代理">3. git代理</h1>
<pre><code class="language-dos"># 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
</code></pre>
<p>也可以直接编辑~/.gitconfig文件</p>
<h1 id="4-windows配置beyondcompare作为gitdiff">4. windows配置beyondcompare作为gitdiff</h1>
<p>修改.gitconfig配置文件</p>
<pre><code class="language-text">[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &quot;bc4&quot;]
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot;&quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &quot;bc4&quot;] 
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot; \&quot;$BASE\&quot; \&quot;$MERGED\&quot;&quot; 
    trustExitCode = true
</code></pre>
<h1 id="5-删除重复文件">5. 删除重复文件</h1>
<pre><code class="language-poweshell"># 预览模式
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}<div class="article-page-layout">
    <div class="article-main-column">
        <article>
            <header>
                <div class="article-header-wrapper">
                    <h1>效率工具</h1>
                    <div class="article-header-actions">
                        <button type="button"
                                class="article-presenter-btn"
                                data-presenter-toggle
                                title="Presenter mode"
                                aria-label="Open presenter mode">
                            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <rect x="2" y="4" width="20" height="14" rx="2"></rect>
                                <path d="M8 20h8"></path>
                                <path d="M12 18v2"></path>
                            </svg>
                            <span>Presenter</span>
                        </button>
                        <a href="assets/markdown/效率工具.md"
                           download="效率工具.md"
                           class="markdown-export-btn"
                           title="Download Markdown source"
                           aria-label="Export Markdown">
                            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                                <polyline points="7 10 12 15 17 10"></polyline>
                                <line x1="12" y1="15" x2="12" y2="3"></line>
                            </svg>
                        </a>
                    </div>
                </div>
                <time datetime="2025-09-17T13:31:12.000Z">2025年9月17日</time>
                <div class="tags">
                    
                </div>
            </header>
            <section class="content">
                <h1 id="1-添加环境变量">1. 添加环境变量</h1>
<pre><code class="language-shell">[Environment]::SetEnvironmentVariable(&quot;EDITOR&quot;, &quot;code --wait&quot;, &quot;User&quot;)
</code></pre>
<h1 id="2-windows命令行代理">2. windows命令行代理</h1>
<pre><code class="language-dos">set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
</code></pre>
<h1 id="3-git代理">3. git代理</h1>
<pre><code class="language-dos"># 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
</code></pre>
<p>也可以直接编辑~/.gitconfig文件</p>
<h1 id="4-windows配置beyondcompare作为gitdiff">4. windows配置beyondcompare作为gitdiff</h1>
<p>修改.gitconfig配置文件</p>
<pre><code class="language-text">[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &quot;bc4&quot;]
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot;&quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &quot;bc4&quot;] 
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot; \&quot;$BASE\&quot; \&quot;$MERGED\&quot;&quot; 
    trustExitCode = true
</code></pre>
<h1 id="5-删除重复文件">5. 删除重复文件</h1>
<pre><code class="language-poweshell"># 预览模式
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Remove-Item -Force
</code></pre>

            </section>
        </article>

        
        <section class="comments-section" id="comments">
            <h2 class="comments-title">评论</h2>
            <div class="utterances-container">
                <script src="https://utteranc.es/client.js"
        repo="shinerio/shinerio.github.io"
        issue-term="效率工具"
        label="blog-comment"
        theme="preferred-color-scheme"
        crossorigin="anonymous"
        async>
</script>
            </div>
        </section>
        
    </div>

    
    <aside class="article-toc-sidebar" data-presenter-toc-source aria-label="Table of contents">
        <div class="article-toc-card">
            <h2 class="article-toc-title">目录</h2>
            <nav class="article-toc-nav">
                <ul class="toc-list"><li class="toc-level-1"><a href="#1-添加环境变量" class="toc-link">1. 添加环境变量</a></li><li class="toc-level-1"><a href="#2-windows命令行代理" class="toc-link">2. windows命令行代理</a></li><li class="toc-level-1"><a href="#3-git代理" class="toc-link">3. git代理</a></li><li class="toc-level-1"><a href="#4-windows配置beyondcompare作为gitdiff" class="toc-link">4. windows配置beyondcompare作为gitdiff</a></li><li class="toc-level-1"><a href="#5-删除重复文件" class="toc-link">5. 删除重复文件</a></li></ul>
            </nav>
        </div>
    </aside>
    
</div>amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}<div class="article-page-layout">
    <div class="article-main-column">
        <article>
            <header>
                <div class="article-header-wrapper">
                    <h1>效率工具</h1>
                    <div class="article-header-actions">
                        <button type="button"
                                class="article-presenter-btn"
                                data-presenter-toggle
                                title="Presenter mode"
                                aria-label="Open presenter mode">
                            <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <rect x="2" y="4" width="20" height="14" rx="2"></rect>
                                <path d="M8 20h8"></path>
                                <path d="M12 18v2"></path>
                            </svg>
                            <span>Presenter</span>
                        </button>
                        <a href="assets/markdown/效率工具.md"
                           download="效率工具.md"
                           class="markdown-export-btn"
                           title="Download Markdown source"
                           aria-label="Export Markdown">
                            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                                <polyline points="7 10 12 15 17 10"></polyline>
                                <line x1="12" y1="15" x2="12" y2="3"></line>
                            </svg>
                        </a>
                    </div>
                </div>
                <time datetime="2025-09-17T13:31:12.000Z">2025年9月17日</time>
                <div class="tags">
                    
                </div>
            </header>
            <section class="content">
                <h1 id="1-添加环境变量">1. 添加环境变量</h1>
<pre><code class="language-shell">[Environment]::SetEnvironmentVariable(&quot;EDITOR&quot;, &quot;code --wait&quot;, &quot;User&quot;)
</code></pre>
<h1 id="2-windows命令行代理">2. windows命令行代理</h1>
<pre><code class="language-dos">set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
</code></pre>
<h1 id="3-git代理">3. git代理</h1>
<pre><code class="language-dos"># 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
</code></pre>
<p>也可以直接编辑~/.gitconfig文件</p>
<h1 id="4-windows配置beyondcompare作为gitdiff">4. windows配置beyondcompare作为gitdiff</h1>
<p>修改.gitconfig配置文件</p>
<pre><code class="language-text">[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &quot;bc4&quot;]
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot;&quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &quot;bc4&quot;] 
    cmd = &quot;\&quot;D:/Beyond Compare/bcomp.exe\&quot; \&quot;$LOCAL\&quot; \&quot;$REMOTE\&quot; \&quot;$BASE\&quot; \&quot;$MERGED\&quot;&quot; 
    trustExitCode = true
</code></pre>
<h1 id="5-删除重复文件">5. 删除重复文件</h1>
<pre><code class="language-poweshell"># 预览模式
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &quot;D:\document&quot; -File -Recurse | Where-Object {$_.BaseName -match &#39;^.+ \d{1,2}&lt;h1 id=&quot;1-添加环境变量&quot;&gt;1. 添加环境变量&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-shell&quot;&gt;[Environment]::SetEnvironmentVariable(&amp;quot;EDITOR&amp;quot;, &amp;quot;code --wait&amp;quot;, &amp;quot;User&amp;quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;2-windows命令行代理&quot;&gt;2. windows命令行代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;set http_proxy=http://username:password@proxy.domain.com:8080
set https_proxy=https://username:password@proxy.domain.com:8080
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;3-git代理&quot;&gt;3. git代理&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-dos&quot;&gt;# 配置代理
git config --global http.proxy http://username:password@proxy.domain.com:8080
git config --global https.proxy https://username:password@proxy.domain.com:8080
git config --global http.sslverify false

# git config --global https.proxy http://127.0.0.1:7890
# git config --global https.proxy http://127.0.0.1:7890

# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 指定网站代理
git config --global http.https://github.com.proxy http://username:password@proxy.domain.com:8080
# 取消代理  
git config --global --unset http.https://github.com.proxy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也可以直接编辑~/.gitconfig文件&lt;/p&gt;
&lt;h1 id=&quot;4-windows配置beyondcompare作为gitdiff&quot;&gt;4. windows配置beyondcompare作为gitdiff&lt;/h1&gt;
&lt;p&gt;修改.gitconfig配置文件&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-text&quot;&gt;[diff] 
    tool = bc4 
[difftool] 
    prompt = false 
[difftool &amp;quot;bc4&amp;quot;]
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot;&amp;quot; 
[merge]
    tool = bc4 [mergetool] prompt = false 
[mergetool &amp;quot;bc4&amp;quot;] 
    cmd = &amp;quot;\&amp;quot;D:/Beyond Compare/bcomp.exe\&amp;quot; \&amp;quot;$LOCAL\&amp;quot; \&amp;quot;$REMOTE\&amp;quot; \&amp;quot;$BASE\&amp;quot; \&amp;quot;$MERGED\&amp;quot;&amp;quot; 
    trustExitCode = true
&lt;/code&gt;&lt;/pre&gt;
&lt;h1 id=&quot;5-删除重复文件&quot;&gt;5. 删除重复文件&lt;/h1&gt;
&lt;pre&gt;&lt;code class=&quot;language-poweshell&quot;&gt;# 预览模式
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Select-Object FullName

# 实际删除(确认无误后使用)
Get-ChildItem -Path &amp;quot;D:\document&amp;quot; -File -Recurse | Where-Object {$_.BaseName -match &amp;#39;^.+ \d{1,2}$&amp;#39;} | Remove-Item -Force
&lt;/code&gt;&lt;/pre&gt;
#39;} | Remove-Item -Force
</code></pre>

            </section>
        </article>

        
        <section class="comments-section" id="comments">
            <h2 class="comments-title">评论</h2>
            <div class="utterances-container">
                <script src="https://utteranc.es/client.js"
        repo="shinerio/shinerio.github.io"
        issue-term="效率工具"
        label="blog-comment"
        theme="preferred-color-scheme"
        crossorigin="anonymous"
        async>
</script>
            </div>
        </section>
        
    </div>

    
    <aside class="article-toc-sidebar" data-presenter-toc-source aria-label="Table of contents">
        <div class="article-toc-card">
            <h2 class="article-toc-title">目录</h2>
            <nav class="article-toc-nav">
                <ul class="toc-list"><li class="toc-level-1"><a href="#1-添加环境变量" class="toc-link">1. 添加环境变量</a></li><li class="toc-level-1"><a href="#2-windows命令行代理" class="toc-link">2. windows命令行代理</a></li><li class="toc-level-1"><a href="#3-git代理" class="toc-link">3. git代理</a></li><li class="toc-level-1"><a href="#4-windows配置beyondcompare作为gitdiff" class="toc-link">4. windows配置beyondcompare作为gitdiff</a></li><li class="toc-level-1"><a href="#5-删除重复文件" class="toc-link">5. 删除重复文件</a></li></ul>
            </nav>
        </div>
    </aside>
    
</div>amp;#39;} | Remove-Item -Force
</code></pre>
#39;} | Remove-Item -Force

评论