当我进行git推送时,我看到以下内容:
warning: updating the currently checked out branch; this may cause confusion,
as the index and working tree do not reflect changes that are now in HEAD.
Run Code Online (Sandbox Code Playgroud)
我用Google搜索了这条消息,我所能找到的只是一个git邮件列表讨论,作者试图确切地决定如何使这个消息更好地与我沟通真正的问题是什么.
我是怎么造成这种情况的,我该如何解决?
我知道有数千个相似的话题浮出水面.我在这里读了至少5个线程但是为什么我仍然不相信DVCS?
我只有以下问题(注意我只是自私地担心Java项目)
推我!
人们如何处理本地和远程之间不同的shebang?
例如,我的本地python是/ usr/bin/python,而我的web主机是〜/ local/bin/python上专用的python.首席开发人员可能在/ usr/bin/ruby上有ruby,而我的是/ usr/local/bin/ruby.
我手动编辑shebang,但随后git将其标记为更改.理想情况下,我希望git忽略文件的第一行,或者忽略文件中行的正则表达式匹配.
在我看来,这一定是一个非常普遍的问题,但我找不到任何提及它.
我使用git,但我不会在任何方面称自己为专家.
我写了一个非常简单的'部署'脚本作为我的post-update钩子在我的裸git仓库中运行.
变量如下
live domain = ~/mydomain.com
staging domain = ~/stage.mydomain.com
git repo location = ~/git.mydomain.com/thisrepo.git (bare)
core = ~/git.mydomain.com/thisrepo.git
core == added remote into each live & stage gits
Run Code Online (Sandbox Code Playgroud)
既live与stage已经初始化的git回购(非裸)和我已经加入我的裸回购作为远程他们每个人(命名core),这样git pull core stage或git pull core live会从各自的拉动更新的文件branch中的core回购.
脚本如下:
#!/usr/bin/env ruby
# Loop over each passed in argument
ARGV.each do |branch|
# If it matches the stage then 'update' the staging files
if branch == "refs/heads/stage" …Run Code Online (Sandbox Code Playgroud)