msysgit

如何更改git子模块的远程存储库?

主宰稳场 提交于 2019-12-28 19:53:53
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我已经创建了一个带有子模块的git存储库。 我能够告诉子模块本身更改其远程存储库路径,但我不知道如何告诉父存储库如何更改子模块的远程存储库路径。 如果我有点不幸并且必须手动操作,我不会感到惊讶,因为即使删除子模块也不容易。 #1楼 什么对我有用(在Windows上,使用git版本1.8.3.msysgit.0): 使用新存储库的路径更新.gitmodules 从“.git / config”文件中删除相应的行 删除“.git / modules / external”目录中的相应目录 删除签出的子模块目录(不确定是否有必要) 运行 git submodule init 和 git submodule update 确保签出的子模块处于正确的提交状态,然后提交,因为散列可能会有所不同 完成所有这些之后,一切都处于我期望的状态。 我认为存储库的其他用户在更新时会有类似的痛苦 - 在提交消息中解释这些步骤是明智的! #2楼 这些命令将在命令提示符下完成工作,而不会更改本地存储库上的任何文件 git config --file=.gitmodules submodule.Submod.url https://github.com/username/ABC.git git config --file=

如何从Git中的非分段更改中删除说“旧模式100755新模式100644”的文件?

有些话、适合烂在心里 提交于 2019-12-26 21:41:12
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 出于某种原因,当我最初从存储库中获取我的git项目时,我在工作副本中获得了大量文件,这些文件没有对它们进行任何可识别的更改,但是仍然显示在我的未 unstaged changes 区域中。 我在Windows XP上使用Git Gui,当我去查看文件时看看有什么变化。 我只看到: old mode 100755 new mode 100644 有谁知道这意味着什么? 如何从我的未分级更改列表中获取这些文件? (非常讨厌必须通过100个文件,只是挑选我最近编辑过的文件并想要提交)。 #1楼 这看起来像我的unix文件权限模式( 755 = rwxr-xr-x , 644 = rw-r--r-- ) - 旧模式包含+ x(可执行)标志,新模式不包括。 这个msysgit问题的回复 建议将core.filemode设置为false以解决问题: git config core.filemode false #2楼 您可以尝试使用git reset --hard HEAD将repo重置为预期的默认状态。 #3楼 将 core.filemode 设置为false确实有效,但要确保 ~/.gitconfig 中的设置不会被 .git/config 的设置覆盖。 #4楼 看来你已经改变了目录的一些权限。 我做了以下步骤来恢复它

Post-Update Git Hook Not Finding Directory

我们两清 提交于 2019-12-24 14:03:19
问题 I am setting up an environment where I can push changes done locally on my workstation to "Hub" repository (which is a remote) and then a post-update hook will automatically update my staging web site, which is the "Prime". I'm doing this so that I can see my changes get automatically reflected in my staging site when I push to my remote hub. This set up is based on this article. My server is Windows 2012 and I'm using MSysGit on both the server and my workstation (Windows 7). Everything is

Git on windows, is it truly distributed?

时光毁灭记忆、已成空白 提交于 2019-12-24 09:48:44
问题 I am just starting out with git on the Windows platform. I have mysygit installed and bar a few hiccups I am 'git'ing away nicely. However, I must be missing something because I don't understand how two msysgit clients on different Windows machines can push and pull to each other directly? I am a complete linux noob but I think I can see that the ssh thing allows distribution on linux. However, the msysgit client appears just to be additional commands in the windows cmd prompt and there is no

How to make msysgit installation a remote repository

眉间皱痕 提交于 2019-12-24 06:45:02
问题 In my development environment at home I want to install msysgit im my local machine and in a server that I have. The goal is to develop in my local machine and then pushing it to the server (remote repository), for the nightly builds. Unfortunately, I can't seem to config the server's msysgit installation to be a remote repository. How can I do that? 回答1: You could simply share a .git repository over windows filesharing, having the share mounted (assigned a drive letter). That way you can

我如何获得Git提交计数?

 ̄綄美尐妖づ 提交于 2019-12-23 18:43:39
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我想得到我的Git存储库的提交数量,有点像SVN版本号。 目标是将其用作唯一的递增构建号。 我目前在Unix / Cygwin / msysGit上喜欢这样: git log --pretty=format:'' | wc -l 但我觉得这有点像黑客。 有没有更好的方法呢? 如果我实际上不需要 wc 甚至Git,那将是很酷的,所以它可以在裸Windows上运行。 只需读取文件或目录结构...... #1楼 如果您只是使用一个分支,例如master,我认为这会很有效: git rev-list --full-history --all | wc -l 这只会输出一个数字。 您可以将其别名为 git revno 使事情变得非常方便。 为此,请编辑 .git/config 文件并将其添加到: [alias] revno = "!git rev-list --full-history --all | wc -l" 这不适用于Windows。 我不知道该操作系统相当于“wc”,但编写一个Python脚本来为你做计数将是一个多平台的解决方案。 #2楼 Git shortlog是获取提交详细信息的一种方法: git shortlog -s -n 这将给出作者姓名后面的提交数量。 -s选项删除作者所做的每个提交的所有提交消息。

Git gui mergetool TortoiseMerge wrong file path

邮差的信 提交于 2019-12-22 18:19:39
问题 i'm having some problems configuring the git gui to run tortoisemerge In my .config there are these lines [merge] tool = tortoisemerge [mergetool "tortoisemerge"] path = C:\\Program Files\\TortoiseSVN\\bin\\TortoiseMerge.exe cmd = 'C:\\Program Files\\TortoiseSVN\\bin\\TortoiseMerge.exe' -base:"$BASE" -mine:"$LOCAL" -theirs:"$REMOTE" -merged:"$MERGED" keepBackup = false When i do 'git mergetool' from bash the tortoisemerge starts correctly I also modified mergetool.tcl adding the in the switch

Git: How do I set up SSH keys to access my remote repository from a second computer?

谁都会走 提交于 2019-12-22 10:34:00
问题 I have a git repository on Unfuddle, and a Windows machine I'm using with msysgit. I set up an SSH key on that machine using ssh-keygen, which gave me some key files. I copied the contents of the public key file into my personal settings in my Unfuddle account, and that works fine. So what do I need to do to get it working on a second machine? If I follow the same process, I'll have to put the new public key into my Unfuddle account, so presumably the old machine will stop working. Is there

msysGit sudo-like command

笑着哭i 提交于 2019-12-22 05:07:44
问题 If we open msysgit as administrator, we can use it as if we were root. However, it is often easier to open without administrator privileges. For example, for administrator privileges, you often have to go to Windows Explorer, the Start menu/screen, etc., and you can't do this from the taskbar. Sometimes, I'm too lazy to do all this, but I want to gain administrator privileges while in Bash. Is there a sudo - or su -like command or script, etc., for Git Bash? Going into cmd.exe , PowerShell ,

Is there an opposite command to git archive for importing zip files

穿精又带淫゛_ 提交于 2019-12-21 17:43:08
问题 Our local workflow tends to use a sequence of zip files as the local 'source control' before major revisions are formalised into the 'big' company SCM system. I'm trying to introduce git as a better local SCM method. The current workflow is quite effective for our small team, particularly as test machines are off net, as zip transfer is easy, so I need to be able to dovetail the two methods. Is there a git command(s) that will import a project zip file and perhaps commit it? Or is it a case