Change email address in Git
2022-08-13
Question I have a project hosted in Git stash (now rebranded as Bitbucket Server). It is built using Jenkins. Now I made a typo while installing my Git locally. Like @ab.example instead of @abc.example After every build, Jenkins sends email notifications and it picks up my incorrect email address from Git commit and tries to send it. Even after I have changed the email address in my local Git, I still see Jenkins sending the emails to the old incorrect address.…
How do I remove msysgit's right click menu options?
2022-08-12
Question This isn't the best programming question but lets face it, the server fault guys aren't well versed in git, so I think its more towards this audience. I want to switch to TortoiseGit, or PortableGit in my shell, but I'm left with these annoying context-menu options. How do I get them to go away? Do I have to write a script to uninstall them? Answer 64-Bit Windows From a cmd.…
git: fatal: I don't handle protocol 'http'
2022-08-11
Question I copy and pasted an git clone command from a web page: https://fedorahosted.org/ibus-typing-booster/ I got this: user@host> git clone http://git.fedorahosted.org/git/ibus-typing-booster.git Cloning into ‘ibus-typing-booster’… fatal: I don’t handle protocol ‘http’ Answer I copied and pasted the whole line git clone http://.... The character between git clone and http://... looks like a space, but it is a special Unicode character! Short answer: After removing this character, and entering a real space, it worked!…
How do I git rm a file without deleting it from disk? [duplicate]
2022-08-11
Question This question already has answers here: </div> Remove a file from a Git repository without deleting it from the local filesystem (14 answers) Closed 9 years ago. The command removes the file in my system. I meant it to remove only the file from Git-repository. How can I remove the file from a Git repository, without removing the file in my system? Answer git rm --cached file should do what you want.…
How can I archive git branches?
2022-08-10
Question I have some old branches in my git repository that are no longer under active development. I would like to archive the branches so that they don't show up by default when running git branch -l -r. I don't want to delete them, because I want to keep the history. How can I do this? I know that it's possible to create a ref outside of refs/heads. For example, refs/archive/old_branch.…
How can I deal with this Git warning? "Pulling without specifying how to reconcile divergent branches is discouraged"
2022-08-10
Question After a git pull origin master, I get the following message: warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one of the following commands sometime before your next pull: git config pull.rebase false # merge (the default strategy) git config pull.rebase true # rebase git config pull.ff only # fast-forward only You can replace “git config” with “git config –global” to set a default preference for all repositories.…
How do I make git use the editor of my choice for editing commit messages?
2022-08-10
Question How do I globally configure git to use a particular editor (e.g. vim) for commit messages? Answer Setting the default editor for Git Pick one: Set core.editor in your Git config: git config --global core.editor "vim" Set the GIT_EDITOR environment variable: export GIT_EDITOR=vim Setting the default editor for all programs Set the standardized VISUAL and EDITOR environment variables*: export VISUAL=vim export EDITOR="$VISUAL" NOTE: Setting both is not necessarily needed, but some programs may not use the more-correct VISUAL.…