git-config

Unable to auto-detect email address

回眸只為那壹抹淺笑 提交于 2019-12-02 17:49:46
I'm new to SmartGit. I can't commit through my repository, the message I'm receiving is: Unable to auto-detect email address (got 'Arreane@Arreane-PC.(none)') *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository I'm using a different PC, but if I commit at home it commits and pushes perfectly, I don't know if this was the cause of the problem. I've searched around and others say to edit the .git/config file, but I cannot

What is $(prefix) on $(prefix)/etc/gitconfig?

巧了我就是萌 提交于 2019-12-01 15:28:32
gitconfig(1) : If not set explicitly with --file, there are four files where git config will search for configuration options: ... $(prefix) /etc/gitconfig System-wide configuration file. What is $(prefix) on $(prefix)/etc/gitconfig ? The prefix environment variable git was compiled with. Usually, it's empty, so the path is /etc/gitconfig . 来源: https://stackoverflow.com/questions/19713622/what-is-prefix-on-prefix-etc-gitconfig

How can I force “git commit -s” using “git commit” command?

℡╲_俬逩灬. 提交于 2019-12-01 14:07:49
I'm looking for a way to write the Signed-off-by: tag automatically when I commit. I tried configuring it through the .git/config file (Reference) . I put these lines of code: [alias] commit = commit -s This did not work. As commented below, you can not edit git's own alias (like commit). (Reference) I also tried using the command (Reference) : git config --global format.signoff true Also had no effect. This explains why. I'm looking for any solution that automatically places the tag and allows me to edit the commit message directly on git, without having to use a system alias. [Edit made

How can I force “git commit -s” using “git commit” command?

这一生的挚爱 提交于 2019-12-01 13:21:31
问题 I'm looking for a way to write the Signed-off-by: tag automatically when I commit. I tried configuring it through the .git/config file (Reference). I put these lines of code: [alias] commit = commit -s This did not work. As commented below, you can not edit git's own alias (like commit).(Reference) I also tried using the command (Reference): git config --global format.signoff true Also had no effect. This explains why. I'm looking for any solution that automatically places the tag and allows

Git listing non-existent remotes

做~自己de王妃 提交于 2019-12-01 05:15:40
I recently made some changes to my remote repos in my Git repo config file. I renamed the remote names, changing my origin to another remote repo and renaming my old origin. For example, I had this previously: [remote "origin"] url = blah blah [remote "future"] url = blah blah I went in and changed them so they look like this: # formerly the origin [remote "old-origin"] # formerly the future repo [remote "origin'] But now, when I type git branch -a , I am seeing branches listed from the old 'future' remote: remotes/origin/HEAD remotes/origin/branch1 remotes/origin/branch2 remotes/future

How does [github] section of .gitconfig work?

断了今生、忘了曾经 提交于 2019-12-01 03:43:55
I'm wondering how github can read in these values? I could see a use of this for deployments etc. if I can define my own, custom sections. Thanks GitHub cannot read those values. If some random company on the other side of the world could just willy-nilly read any arbitrary files on your computer, that would be truly scary. But of course any program you run on your computer can read those values. Including, for example, the hub command or the github command, which are two popular commandline clients for GitHub. 来源: https://stackoverflow.com/questions/4269732/how-does-github-section-of

Using gitconfig per branch

别等时光非礼了梦想. 提交于 2019-11-30 23:00:46
Our company uses many customized opensource project. Whenever I contribute upstream branch I have change to use my personal email/name. Is there any way to have gitconfig per branch? For example what I want is [remote 'gerrit'] name = 'Personal Name' [branch 'origin'] name = 'Name in company' You can use post-checkout hook for this. Run $ touch .git/hooks/post-checkout $ chmod a+x .git/hooks/post-checkout Add contents to post-checkout script (edit names and branches as neccessary) #!/bin/bash # $3 "0" - checking out file. "1" - checking out branch. [[ "$3" == "0" ]] && exit 0 branch=$(git

Using Notepad++ as Git Editor without affecting settings

我与影子孤独终老i 提交于 2019-11-30 11:46:14
I use and love Notepad++ ( http://notepad-plus-plus.org/ ) as my go to simple text editor. I have been using it as my default editor for git for a few weeks now and have noticed some funny behavior. Normally I run Notepad++ with the Tab Bar enabled like so However when I use Notepad++ as my git editor I would prefer it to open in the most basic mode possible (mainly no tabs, and in its own instance) I simply want a text editor to log my commit messages and such. The relevant section of my .gitconfig is setup as follows [core] autocrlf = true editor = "'C:/Program Files (x86)/Notepad++/notepad+

Delete username from a Git repository

最后都变了- 提交于 2019-11-30 11:17:19
I am getting this warning when I try to set my user name in Tower : warning: user.name has multiple values I have checked in a terminal window and found that I have three usernames: macmini:HiBye shannoga$ git config --get-all user.name Shani shani shani How can I delete two of the user names? svick Use git config -e and you should see something like: [user] name = Shani name = shani name = shani Delete the lines you don't want. Aesch This worked for me on my Mac: git config --global --unset-all user.name If you want to replace the wrong ones with the proper one: git config --global --replace

Git ignoring gitconfig?

Deadly 提交于 2019-11-30 08:25:02
问题 It appears Git is ignoring ~/.gitconfig $ git config --global core.filemode false $ git config -l core.filemode=false core.filemode=true So now there are 2 entries for core.filemode and git is still not ignoring filemode changes $ touch modetest $ git add . $ git commit -m test1 [master (root-commit) 320cfe4] test1 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 modetest $ chmod +x modetest $ git diff diff --git a/modetest b/modetest old mode 100644 new mode 100755 Based