Github for Windows Git Shell (PowerShell) - 如何 "sync settings" 跨越 Git Shell 和正常功率Shell
Github for Windows Git Shell (PowerShell) - How to "sync settings" across Git Shell and normal PowerShell
我在让我的普通 PowerShell 完全像 GitHub for Windows 附带的那样工作时遇到了一些问题。我有 posh-git 在我的 PS 配置文件中使用类似 this 的东西(如下所示),实际上我可以使用 Git,但有些东西我'使用两者时,我注意到的是不同的。
# Load github shell and posh-git example profile
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. (Resolve-Path "$env:github_posh_git\profile.example.ps1")
特别是两者的配置不同。如果我输入 git config --list
,我可以看到 GfW 的 Git Shell 中还有更多内容。我通过尝试使用 git difftool
遇到了这个问题,但它不起作用(在 Git Shell 中它将使用 VS2013)。以下是两者列表中的一些内容。
Git Shell(GitWindows 的中心):
> git config --list
alias.c=commit
alias.co=checkout
alias.dt=difftool
alias.mt=mergetool
alias.praise=blame
alias.ff=merge --ff-only
alias.st=status
alias.sync=!git pull && git push
apply.whitespace=nowarn
core.symlinks=false
core.autocrlf=true
core.editor=gitpad
core.preloadindex=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
color.ui=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle-ghfw.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=!github --credentials
filter.ghcleansmudge.clean=cat
filter.ghcleansmudge.smudge=cat
push.default=upstream
diff.tool=vs2013
diff.algorithm=histogram
difftool.prompt=false
difftool.bc4.cmd="c:/program files (x86)/beyond compare 3/bcomp.exe" "$LOCAL" "$REMOTE"
difftool.p4.cmd="c:/program files/Perforce/p4merge.exe" "$LOCAL" "$REMOTE"
difftool.vs2012.cmd="c:/program files (x86)/microsoft visual studio 11.0/common7/ide/devenv.exe" '//diff' "$LOCAL"
"$REMOTE"
difftool.vs2013.cmd="c:/program files (x86)/microsoft visual studio 12.0/common7/ide/devenv.exe" '//diff' "$LOCAL"
"$REMOTE"
merge.tool=bc3
mergetool.prompt=false
mergetool.keepbackup=false
.......
正常功率Shell:
> git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=Jordan Harris
user.email=****************
filter.lfs.clean=git lfs clean %f
filter.lfs.smudge=git lfs smudge %f
filter.lfs.required=true
gui.recentrepo=C:/Users/Jordan/SkyDrive/Documents/JUCE/Projects/CustomKnob2
core.editor=atom --wait
core.autocrlf=false
我真的很想在 Console2(或 ConsoleZ)中使用 PowerShell,所以在两个 PowerShell 之间具有相同的配置真的很棒。我使用普通 Powershell 的原因是因为我无法让 Git Shell 在 Console2 中工作。如果有人知道如何让它与 Console2 一起使用,我会很好地使用它。非常感谢大家的帮助。
注意:当我说 "Git Shell" 时,我指的是 Git Hub for Windows 附带的快捷方式 Git Shell。这与从 GfW 应用程序打开它相同。
将您的设置放入主目录中名为 .gitconfig
的文本文件中(即 C:\Users\username)。
这就是 second widest scope of settings,它将应用于 当前用户 的所有存储库,而不管正在使用的客户端应用程序如何。
您可以通过将 --global
开关切换到 git config
来修改这些设置。例如:
git config --global core.autocrlf false
我在让我的普通 PowerShell 完全像 GitHub for Windows 附带的那样工作时遇到了一些问题。我有 posh-git 在我的 PS 配置文件中使用类似 this 的东西(如下所示),实际上我可以使用 Git,但有些东西我'使用两者时,我注意到的是不同的。
# Load github shell and posh-git example profile
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
. (Resolve-Path "$env:github_posh_git\profile.example.ps1")
特别是两者的配置不同。如果我输入 git config --list
,我可以看到 GfW 的 Git Shell 中还有更多内容。我通过尝试使用 git difftool
遇到了这个问题,但它不起作用(在 Git Shell 中它将使用 VS2013)。以下是两者列表中的一些内容。
Git Shell(GitWindows 的中心):
> git config --list
alias.c=commit
alias.co=checkout
alias.dt=difftool
alias.mt=mergetool
alias.praise=blame
alias.ff=merge --ff-only
alias.st=status
alias.sync=!git pull && git push
apply.whitespace=nowarn
core.symlinks=false
core.autocrlf=true
core.editor=gitpad
core.preloadindex=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
color.ui=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle-ghfw.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=!github --credentials
filter.ghcleansmudge.clean=cat
filter.ghcleansmudge.smudge=cat
push.default=upstream
diff.tool=vs2013
diff.algorithm=histogram
difftool.prompt=false
difftool.bc4.cmd="c:/program files (x86)/beyond compare 3/bcomp.exe" "$LOCAL" "$REMOTE"
difftool.p4.cmd="c:/program files/Perforce/p4merge.exe" "$LOCAL" "$REMOTE"
difftool.vs2012.cmd="c:/program files (x86)/microsoft visual studio 11.0/common7/ide/devenv.exe" '//diff' "$LOCAL"
"$REMOTE"
difftool.vs2013.cmd="c:/program files (x86)/microsoft visual studio 12.0/common7/ide/devenv.exe" '//diff' "$LOCAL"
"$REMOTE"
merge.tool=bc3
mergetool.prompt=false
mergetool.keepbackup=false
.......
正常功率Shell:
> git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=Jordan Harris
user.email=****************
filter.lfs.clean=git lfs clean %f
filter.lfs.smudge=git lfs smudge %f
filter.lfs.required=true
gui.recentrepo=C:/Users/Jordan/SkyDrive/Documents/JUCE/Projects/CustomKnob2
core.editor=atom --wait
core.autocrlf=false
我真的很想在 Console2(或 ConsoleZ)中使用 PowerShell,所以在两个 PowerShell 之间具有相同的配置真的很棒。我使用普通 Powershell 的原因是因为我无法让 Git Shell 在 Console2 中工作。如果有人知道如何让它与 Console2 一起使用,我会很好地使用它。非常感谢大家的帮助。
注意:当我说 "Git Shell" 时,我指的是 Git Hub for Windows 附带的快捷方式 Git Shell。这与从 GfW 应用程序打开它相同。
将您的设置放入主目录中名为 .gitconfig
的文本文件中(即 C:\Users\username)。
这就是 second widest scope of settings,它将应用于 当前用户 的所有存储库,而不管正在使用的客户端应用程序如何。
您可以通过将 --global
开关切换到 git config
来修改这些设置。例如:
git config --global core.autocrlf false