git-config

Using Git on Windows, behind an HTTP proxy, without storing proxy password on disk

邮差的信 提交于 2019-11-28 17:51:19
I'm using Git on Windows, on a corporate network where I'm behind an HTTP proxy with Basic authentication. Outbound SSH doesn't work, so I have to use HTTPS through the proxy. I'm aware of how to use git config http.proxy to configure the settings as http://[username]:[password]@[proxy]:[port] . However, particularly as this is a shared machine, I'd rather not store my password in my .gitconfig . Additionally, changing my .gitconfig using the git config command leaves my password in my bash history, so even if I remember to clear my .gitconfig at the end of the session, I'll almost certainly

“simple” vs “current” push.default in git for decentralized workflow

家住魔仙堡 提交于 2019-11-28 15:50:47
Functionally speaking, in a decentralized workflow, I don't see the difference between simple and current options for push.default config setting. current will push the current branch to an identically named branch on the specified remote. simple will effectively do the same thing as well for both the tracked and any untracked remotes for the current branch (it enforces identical branch names in both cases). Can someone explain any important differences between the two for decentralized workflows that I am missing? The difference is that with simple , git push (without passing a refspec) will

git:// through proxy

假如想象 提交于 2019-11-28 15:21:07
I'm behind a firewall that is blocking port 9418 (git) and am trying to install some tools that are explicitly doing a checkout of git://github.com/... , so I can't switch to https for the checkout. So I'm wondering if it's possible to redirect all traffic to port 9418 through a proxy and if so how :) Have a look at core.gitproxy setting in Git config . Quick googling revealed this script that may be useful (or may not — I did not try it): https://gist.github.com/49288 If you are talking about git submodules, try this: git config --global url.https://github.com/.insteadOf git://github.com/ ..

With Git, how do I turn off the “LF will be replaced by CRLF” warning

微笑、不失礼 提交于 2019-11-28 15:17:00
With Git, when using the autocrlf = true flag, a warning is still given when line-endings are changed. I understand what the warning is for, and how to turn off the line-ending flag, but how do I turn off the warning itself? You can turn off the warning with git config --global core.safecrlf false (This will only turn off the warning, not the function itself.) You should use core.autocrlf input and core.eol input . Or just don't let git change the line endings at all with autocrlf false and get rid of highlighting of crlfs in diffs, etc with core.whitespace cr-at-eol . Hope this helps Pat Notz

Is it possible to have different Git configuration for different projects?

流过昼夜 提交于 2019-11-28 14:58:23
.gitconfig is usually stored in the user.home directory. I use a different identity to work on projects for Company A and something else for Company B (primarily the name / email). How can I have two different Git configurations so that my check-ins don't go with the name / email? The .git/config file in a particular clone of a repository is local to that clone. Any settings placed there will only affect actions for that particular project. (By default, git config modifies .git/config , not ~/.gitconfig - only with --global does it modify the latter.) There are 3 levels of git config; project,

How do I configure Araxis Merge for use with Git?

二次信任 提交于 2019-11-28 10:55:43
I understand that Araxis Merge is now a "fully supported" mergetool for Git, so that much of what I can find about configuring Git to use it is now out of date. In particular, Araxis Merge should work "out of the box" simply by executing git config --global merge.tool araxis provided araxis is on my PATH. However, for a several reasons, amending my PATH is not an option, so I need to be able to specify the correct path or cmd in .gitconfig . How should I configure Git (on OS X) so that it finds Araxis Merge? Simply following the example of other tools like kdiff3 and p4merge with git config -

Understanding .git/config's 'remote' and 'branch' sections

萝らか妹 提交于 2019-11-28 09:27:00
Here's the contents of the remote and branch sections of my .git/config file. [remote "origin"] url = https://EvanAad@bitbucket.org/EvanAad/bitbucketstationlocations.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master What is the meaning and purpose of the contents of these sections, in particular the fetch and merge subsections? How is this information used by Git to guide its operation? CodeWizard Its called refspec. Its the mechmism that git is using to "talk" to the remote server and to map local branches to remote branches. Refspecs

Windows-specific Git configuration settings; where are they set?

烂漫一生 提交于 2019-11-28 08:09:09
I've read the Git documentation and Where do the settings in my Git configuration come from? and yet I still can't make sense of some of my settings. I'm on Git 2.5.3 on Windows 10. Here's the output of git config -l : λ git config -l 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=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt sendemail.smtpserver=/bin/msmtp.exe diff.astextplain.textconv=astextplain rebase.autosquash=true user.name=Ben Collins user.email=#redacted#

What's the difference between `git config` and `git push --set-upstream`

别等时光非礼了梦想. 提交于 2019-11-28 06:03:18
问题 Question What's the difference between: $ git remote add origin git@github.com:yourname/yourproject.git $ git config remote.origin.push refs/heads/master:refs/heads/master $ git push and: $ git remote add origin git@github.com:yourname/yourproject.git $ git push origin master -u Is the second version simply newer and shorter than the first version, or are there other differences? Background Research As of Git 1.7.0, you can use the --set-upstream option with git push . According to the git

How to tell git to use the correct identity (name and email) for a given project?

一世执手 提交于 2019-11-28 03:03:07
I use my personal laptop for both work and personal projects and I would like to use my work email address for my commits at work (gitolite) and my personal email address for the rest (github). I read about the following solutions which are all either global or temporary: git config --global user.email "bob@example.com" git config user.email "bob@example.com" git commit --author "Bob <bob@example.com>" setting one of the GIT_AUTHOR_EMAIL , GIT_COMMITTER_EMAIL or EMAIL environment variables One solution is to run manually a shell function that sets my environment to work or personal , but I am