git history of a source line

This question already has an answer here: Git: discover which commits ever touched a range of lines 6 answers

Logout and login as another user git bash

I want to logout from Git bash and login it again as another user . I have googled but can’t find any solution.

How do you set up Hudson to work with Git?

I’m trying to set up Hudson as a CI Server and I’m having trouble getting everything to work. I’m trying to use the ‘official’ git plugin. I haven’t done any testing with the alternate plugin developed by stephenh. I’m wondering if anyone else has gotten Hudson to work with Git or any CI server to […]

Can not create a local and remote branch (tracking) at the same time

From Pro Git: you can set up other tracking branches if you wish — ones that don’t track branches on origin and don’t track the master branch. The simple case is the example you just saw, running git checkout -b [branch] [remotename]/[branch] $ git checkout –track origin/serverfix Branch serverfix set up to track remote branch […]

Git rebase gets stuck after resolving merge conflict

I’m running a rebase that hits a conflict: $ git rebase master First, rewinding head to replay your work on top of it… Applying: Better `SelectMotifsView.js` Using index info to reconstruct a base tree… M browser/AddLinkView.js M browser/SelectMotifsView.js M browser/index.html Falling back to patching base and 3-way merge… Auto-merging browser/index.html CONFLICT (content): Merge conflict in […]

Can I run a password-protected, read-only git server?

I need an application to be able to fetch from a git repository but not push to it, so, that’s the read-only part. That could easily be done with git daemon. On top of that, I need access to said repository to be password-protected, including for reading it. So before any fetching can happen, the […]

git – rebase ruins merge

I had two branches both independent. I worked on them at various points over a month. I went to merge one branch (let’s call it apple) into the other (let’s call it orange) by checking out orange and doing git merge –no-ff apple and everything went fine. In gitk I could clearly see the branches […]

Setup 'git diff' for special file types

I want to manage Excel files in one of my repositories. Diffing them is a problem (they are binary files). However, there is a nice tool for diffing them: https://github.com/na-ka-na/ExcelCompare I wanted to set it up using .gitattributes *.xls diff=excel *.xlsx diff=excel And in the .git/config: [diff “excel”] textconv = excel_cmp.bat The command excel_cmp.bat file1.xls […]

git merge strategy for static config file in each branch

We need a systematic way of ignoring a specific config file for the branches we maintain on git. i.e. we have a config.xml file with database, environment, and other info across ‘develop’ and ‘master’ branches that we’d like to keep out of the outcomes of ‘git merge‘. We followed the SCM book instructions for merge […]

Git: Prevent fast-forward merges only when merging external branches into master

In order to make it easy to see when feature branches are merged to master, one can use Git’s –no-ff option when merging their feature branch into master. One way to accomplish this without needing to type –no-ff is to disable fast-forward merges into master entirely: git config branch.master.mergeoptions –no-ff However, this is clumsy since […]

Git Baby is a git and github fan, let's start git clone.