我的主要目的是过滤掉所有拉请求合并,因此理论上我希望以下工作(它没有)
git log --grep="^!(Merge)"
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
刚刚开始使用Git.
我在Bitbucket上有一个现有的个人帐户,我也使用我的工作电子邮件地址创建了一个团队帐户.
我创建了一个存储库,让它工作,克隆它等等.然后我做了一些测试提交和推送.我相信我在初次推送时输入了我的工作电子邮件和密码.我实际上并不是100%肯定,因为最初的连接有点困难,我尝试了几个不同的东西.
我现在看到提交和推送BitBucket,这很棒,但它显示我的个人帐户作为提交者,团队帐户作为推动者.
我运行了git configure -l,它显示了我的个人电子邮件和名称user.name和user.email.看来我作为一个用户提交并推送另一个用户,但我不知道在哪里可以找到这些信息.
如果重要,我使用git扩展来提交和推送,但我使用Git Bash进行了初始设置.我使用的是https网址.
如何更改用于执行推送的用户凭据?
我的项目中有一个目录被忽略,但它不在我希望忽略文件夹的任何地方(.gitignore,exclude或config).
它是我用gradle构建的Android Studio项目,我的VCS是Git.我正在使用SourceTree和GitBash来管理回购.我已将项目中的所有.ignore文件重置为空,\ info\exclude为空,config没有'excludesfile'属性.
被忽略的文件夹是 - 'myProj/app/src/debug/res/raw /'首先不知道这个文件夹是如何被忽略的.有一个不同的相对文件夹'myProj/app/src/debug/res/values'由git跟踪.
有没有其他地方我没有看起来设置忽略文件?是否有任何git命令可以显示此文件夹被设置为忽略文件夹的位置?也许我忽略了一个二进制文件,我可以删除?
目前运行'git status --ignored'只显示'myProj/app/src/debug/res/raw /'被忽略.
表演时:
$ git push -u origin --all
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
remote: error: insufficient permission for adding an object to repository database ./objects
Run Code Online (Sandbox Code Playgroud)
我搜索了一下,并找到了Richard Hansen的解决方案。
我必须执行:
$ git config core.sharedRepository group
Run Code Online (Sandbox Code Playgroud)
相反,我将其执行为:
$ git config core.sharedRepository dev
Run Code Online (Sandbox Code Playgroud)
因为我以为我必须在实际命令中输入组的名称(此处“ dev”是具有用户的组的名称,名为“ gituser”)。
从那时起,每当我尝试在Git Bash中执行任何命令时,都说:
fatal: bad numeric config value 'dev' for 'core.sharedrepository' in .git/config: invalid unit
Run Code Online (Sandbox Code Playgroud)
为此,我也在此链接中找到了解决方案
其中说:
当您为git config core.sharedRepository输入无效值时,它可能会连续失败,而不是让您使用此命令再次更新:
Run Code Online (Sandbox Code Playgroud)git core.sharedRepository group在这种情况下,您将需要打开.git / config文件并手动更改文件,如下所示:
Run Code Online (Sandbox Code Playgroud)[core] ... sharedRepository = group
我做到了,但徒劳无功。仍然Git Bash中的任何命令都给出相同的错误:
fatal: bad numeric config value 'dev' for …Run Code Online (Sandbox Code Playgroud) 所以我在窗户上安装了Leiningen和git.但是git bash似乎没有找到lein命令,因为它基于.bat文件.它适用于Windows命令行.有没有办法让lein命令在git bash中工作?
我通过conemu使用gitbash.
我有一个字符集问题,其中字符在gitbash中通过conemu和gitbash直接显示错误.
我通过将.minttyrc中的语言环境设置为...来修复gitbash.
BoldAsFont=-1
Locale=en_US
Charset=UTF-8
Run Code Online (Sandbox Code Playgroud)
但是当通过conemu发布时,这并没有在gitbash中修复它.
我会改变conemu设置以解决区域设置或让它获取.minttyrc设置的任何想法?
此问题可能是特定于Windows的.我还没有在Linux或Mac上测试它.
我用:
node my-cli.js > foo.txt:错误 output is not a tty
node my-cli.js < foo.txt:错误input is not a tty.
在询问之前,该分支refs/remotes/origin/feature/US12376被推到了origin一段时间:
Your branch is based on 'origin/feature/US12376', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
Run Code Online (Sandbox Code Playgroud)
所以我使用git branch --unset-upstream(成功通过).
提交后我尝试git push --set-upstream origin feature/US12376但得到错误:
error: update_ref failed for ref 'refs/remotes/origin/feature/US12376': cannot lock ref 'refs/remotes/origin/feature/US12376': 'refs/remotes/origin/feature/US12376/patchFix' exists; cannot create 'refs/remotes/origin/feature/US12376'
Run Code Online (Sandbox Code Playgroud)
远程分支refs/remotes/origin/feature/US12376/patchFix已删除.
我正在运行命令:
sudo bash
Run Code Online (Sandbox Code Playgroud)
但是我的终端上一直有错误说,
bash: parse_git_branch: command not found
Run Code Online (Sandbox Code Playgroud)
这是我的.bash_profile档案
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w - \$(parse_git_branch)\[\033[00m\] $ "
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM$
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
export PATH=/usr/local/bin:/Applications/XAMPP/xamppfiles/bin:$PATH
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH
export EDITOR='subl -w'
export JAVA_HOME=$(/usr/libexec/java_home)
export JAVA_HOME=$(/usr/libexec/java_home)
export JAVA_HOME=$(/usr/libexec/java_home)
Run Code Online (Sandbox Code Playgroud)
提前致谢.
今天早些时候,我试图生成一个在SubjectAltName扩展名中带有DNSName条目的证书:
$ openssl req -new -subj“ / C = GB / CN = foo” -addext“ subjectAltName = DNS:foo.co.uk” -addext“ certificatePolicies = 1.2.3.4” -key ./private-key.pem -out 〜/ req.pem
此命令导致以下错误消息:
名称应采用/ type0 = value0 / type1 = value1 / type2 = ...的格式,其中的字符可以通过进行转义。该名称不是这种格式:'C:/ Program Files / Git / C = GB / CN = foo'发出证书请求时出现问题
如何停止Git Bash将此字符串参数视为文件路径,或者至少停止对其进行更改?