How do you change the capitalization of filenames in Git?

Starting Git 2.0.1 (June 25th, 2014), a git mv will just work on a case-insensitive OS. See commit baa37bf by David Turner (dturner-tw). mv: allow renaming to fix case on case-insensitive filesystems “git mv hello.txt Hello.txt” on a case-insensitive filesystem always triggers “destination already exists” error, because these two names refer to the same path … Read more

`git fetch` a remote branch

Update: Using Git Switch All of the information written below was accurate, but a new command, git switch has been added that simplifies the effort. If daves_branch exists on the remote repository, but not on your local branch, you can simply type: git switch daves_branch Since you do not have the branch locally, this will … Read more

Using git with ssh-agent on Windows

posh-git and git for windows 2.7 should include everything you need to setup an ssh-agent. Once you have the module installed you can start the agent using something like: Import-Module ~\Documents\WindowsPowerShell\Modules\posh-git\posh-git Set-Alias ssh-agent “$env:ProgramFiles\git\usr\bin\ssh-agent.exe” Set-Alias ssh-add “$env:ProgramFiles\git\usr\bin\ssh-add.exe” Start-SshAgent -Quiet You then should see the SSH_AUTH_SOCK environmental variable is set: C:\Code\Go\src\bosun.org\cmd\scollector [master]> gci env:SSH_AUTH_SOCK Name Value … Read more

Is there a way to use a Mercurial repository as Git submodule?

Using git-hg. First, make sure there is a (non-Mercurial) git submodule under your main repository. If you don’t have other submodules yet, just create a dummy submodule for some library other than core-plot, for instance: main-repo $ git submodule add https://repo.url.com/repo.git repo Second, clone the core-plot library into some directory. main-repo $ git-hg clone https://code.google.com/p/core-plot/ … Read more

Git submodule URL not including username?

If I understand correctly, you’re using HTTP basic authentication over HTTPS to allow only particular developers to access the repository. In that case, you can commit a .gitmodules that looks like: [submodule foo] path = sub/foo url = https://example.com/git/foo.git … i.e. without a user name, and then tell each developer to put their username and … Read more