我甚至不确定我是在问正确的问题.让我解释一下我的情况:
这是关于Windows 7上的Git.
我的公司在网络驱动器上设置Windows用户目录,而不是在本地硬盘驱动器上(用于备份和超出此问题范围的其他目的).我不能改变这个政策.
我可以在该方案之外拥有本地文件,这就是我的Apache服务器的设置方式.完全是当地的.
我安装了Git.它安装了Bash.当我启动Bash和cd ~(更改到根目录)时,我发现它(Bash根目录)指向我的网络用户目录.我希望它不要那样做.我想要 ~在我的硬盘上的其他地方.我想要它,以便当我执行其他操作,如安装证书,SSH密钥等时,其默认值不会自动使用该网络目录.
我到处搜索都是徒劳的,我能找到的所有内容都指的是涉及别名,重定向和$ HOME指向的位置的答案.但这根本不是我想要的.
问题是:我可以更改该目录吗?如果是这样的话:怎么样?
更新:所以,$ HOME是我需要修改的.但是我一直无法找到这个神秘的$ HOME变量的位置,所以我认为它是一个Linux系统版本的PATH或其他东西.无论如何 ......
我的确有一个"个人资料"文件git/etc.以下是内容(注意没有$ HOME):
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along
# with this software.
# If not, see …Run Code Online (Sandbox Code Playgroud) Visual Studio代码报告"看起来您的系统上没有安装git." 当我尝试切换到git视图.我知道我安装了git并被其他git客户端使用.我想如果我按照Visual Studio Code的说明重新安装git("用Chocolatey安装它或从git-scm.com下载它"),它可能可以解决问题,但我不想搞砸现有的git我系统上的客户.是否有可靠的方法来配置Visual Studio代码,以便它可以找到现有的git安装?
虽然其他问题涉及如何使用像git-bash这样的东西,但是给新的WSL一个旋转,因为VS Code的终端不一样:它让你可以访问在实际的Ubuntu Linux子系统上运行的bash,而不是git-在Windows子系统上运行的bash终端.
那么我们如何让它作为VS Code终端工作,特别是我们如何让它作为功能开发环境终端工作呢?
与git-bash不同,遗憾的是,这不是那么简单,因为WSL中的Ubuntu Linux配置可以提供一些陷阱,例如NPM尝试(和失败)从Windows Program Files目录运行,因为WSL和Windows本身之间的交互路径的条款,以及一些像Compass这样的软件包失败的原因并不一定是那些不习惯在Linux上开发的人的明显原因.为VS Code提供可靠的WSL终端环境的简单方法是什么?在通过apt-get或安装时最常用的工具将运行npm?
git bash ubuntu visual-studio-code windows-subsystem-for-linux
我们可以在VS Code中添加多个不同的终端吗?我计划添加以下三个终端并与所有这些一起工作
- Windows命令提示符
- 电源外壳
- Git Bash
我知道我需要添加以下命令 Preferences => Setting
// // 64-bit cmd if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe",
// // 64-bit PowerShell if available, otherwise 32-bit
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
// // Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe",
Run Code Online (Sandbox Code Playgroud)
我想在上面添加以上三个命令 setting.json
当我点击+不同的终端应该打开,我想在不改变首选项的情况下使用这些终端.是否可以在VS Code中使用?
我已经安装了console2和git bash,我的目标是让git bash与标签一起工作,我已经将控制台设置上的目标路径更改为
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i.当我打开控制台时,它不再为选项卡提供选项.
在 Visual Studio Code 中,Ctrl-k 快捷键绑定到清除终端。
我已经在 Windows 中将bash 配置为我的终端,并希望它像传统的 Emacs 键绑定一样工作,也就是说,让它终止行尾。
我尝试在用户设置中禁用此配置的默认键绑定,但它不起作用:
"commandsToSkipShell": [
"workbench.action.terminal.clear"
]
Run Code Online (Sandbox Code Playgroud)
如何让终端服从我20年训练的肌肉记忆?
terminal keyboard-shortcuts visual-studio-code vscode-settings
使用VSCode的Git集成提交文件时,是否有任何编写多行提交消息的方法,或者我仅限于一行?
截至目前,VSCode非常适合暂存文件.但似乎我仍然需要从终端写出大部分提交消息.
我在 Windows 10 上使用 VSCode 1.47.3。我无法在 json 中编辑默认设置:
我尝试以管理员身份打开 VSCode,卸载并重新安装,重新启动计算机,然后降级到 1.46,但仍然无法编辑。有人知道如何解决这个问题吗?
我试图在 Visual Studio Code 中插入 GitBash 作为一个选项。我的设置如下所示:
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"GitBash": {
"source": "GitBash",
"path": ["F:\\Code\\Git\\bin\\bash.exe"],
"icon": "terminal-bash"
}
},
"terminal.integrated.defaultProfile.windows": "GitBash"
Run Code Online (Sandbox Code Playgroud)
但是,在最后一行,Visual Studio Code 给出的错误是:
Value is not accepted. Valid values: "PowerShell", "Command Prompt".(1)
The default profile used on Windows. This setting will currently be ignored if either #terminal.integrated.shell.windows# or #terminal.integrated.shellArgs.windows# are set.
Run Code Online (Sandbox Code Playgroud)
我不明白我哪里出错了。
注意:"terminal.integrated.shell.windows"自 2021 年 4 …
我尝试将 Git Bash 设置为 VSCode 中的默认终端,但无法成功。我已经尝试遵循下一篇文章:
但他们还没有解决我的问题。
我设法在 中生成配置文件settings.json,但 Git Bash 由于某种我未知的原因无法工作,并且 VsCode 显示错误。
我的settings.json:
{
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash",
"path": "C:\\git-sdk-64\\git-bash.exe",
"args": [
"--login",
"-i"
]
},
"Cygwin": {
"path": "C:\\cygwin64\\bin\\bash.exe",
"args": [
"--login"
]
}
},
"terminal.integrated.defaultProfile.windows": …Run Code Online (Sandbox Code Playgroud)