git

Merging selective lines of code using Git?

I would like to force git to always merge using a (kind of) 3-way conflicts resolution. Moreover, I want to do it to the point of being able to choose single lines. At the moment I am merging two branches. However, if possible, I'd like to know how to perform this task even when merging multiple branches. ...

How to get mongrel working with bundler?

Transitioning to bundler with an existing production setup. Naively with a gemfile and setup like: gem "rails", "2.3.8" gem "mongrel", git: "http://github.com/dynamix/mongrel.git" bundle install --path /mnt/app/shared/bundle Starting with bundle exec mongrel_rails start --environment=production ... results in /mnt/app/shared/bun...

How do I programmatically determine if there are uncommited changes?

In a Makefile, I'd like to perform certain actions if there are uncommited changes (either in the working tree or the index). What's the cleanest and most efficient way to do that? A command that exits with a return value of zero in one case and non-zero in the other would suit my purposes. I can run git status and pipe the output thr...

Unable to create Gitosis remote branches

Hi, When pushing branches to a gitosis hosted repository, although I get the expected response from the push command, the remote branches aren't listed when I do git branch -a. Even after a fetch, the branches still do not show up in the list. Interestingly, I find files with names that correspond to the branches I have been trying to p...

Egit very slow at handling big projects

The problem is that Egit/Eclipse is very slow at dealing with big Java projects (~2,000k files). Very slow means following on a windows 7/quad core/SSD setup: 60 seconds for drawing the commit window another 30 s for doing the commit (would be acceptable) 60 s for drawing the push window (changes view) another 120 s for pushing ...

git apply a patch as much as possible when failing

Hi, I am moving from one repository to another and need to port some of the changes. The directory structure is mostly the same but the files not all identical. I am using 'git format-patch' and 'git am' or 'git apply' to port those changes. When it works, life is good, but when it fails because of some minor change or files missing, n...

Heroku Git Repository Size

During late development of an application I've been git pushing to heroku such that the repository there is fairly large. I would like at this stage, before site launch, to remove all old versions from the repo as it seems sensible housekeeping. What would be the best way to go about this so my online application be uninterrupted? ...

What's the easiest way to maintain a patched set of rails gems, with bundler?

We're transitioning from 'frozen' rails gems to using bundler and would like to maintain the rails gems with patches, merges etc. say from an external git source. What's the easiest way to set this up, adding gemspecs to the patch branches etc.? ...

Git changes files on Mac OS X

I just cloned an old repository containing some linux kernel modules (don't ask). If I clone on a linux machine, everything is fine. On my Mac however, someone (presumably Mac OS X) makes binary changes to the modules. I already disabled autocrlf. Here's the output of git diff -p --stat directly after clone: .../kernel/net/ipv4/netfil...

Git: move changes between branches without working directory change

Use-case: every time I want to move commit from one git branch to another I perform the following sequence of actions: [commit into working branch] git checkout [branch-to-merge-into] git cherry-pick [target-commit] git push git checkout [working-branch] That works fine with the only exception - every time I perform 'git checkout' gi...

Git is telling me "Your branch is ahead of 'origin/master' by 2 commits." and I want to discard them

Ok, so I had been working on something, and decided it was completely screwed -- after having committed some of it. So I tried the following sequence: git reset --hard git rebase origin git fetch git pull git checkout At which point I got the message Your branch is ahead of 'origin/master' by 2 commits. I want to get rid of my loca...

Any good tutorial on using TortoiseGit with workflows?

Most git tutorials use command line which is fine but I'm looking for resources specifically showing workflows in TortoiseGit (note the emphasis on workflows, not just installation and basic checkouts / commits). Any links / suggestions? ...

What's an easy way to detect modified files in a GIT workspace?

During make, I create string fields which I embedded in the linked output. Very useful. Other than a complex sed/grep parsing of the git status command, how can I easily determine if files in the workspace have been modified according to git? ...

Anyone know a convenient website suite for open-source projects?

Hi everyone, as the open source project I am working on is moving on to be more popular, we am thinking of upgrading our web site as well. At the moment we use hand-written HTML for most of the things. However, we want to make things more dynamic to allow for better collaboration and making it easier to publish documentation, tutorials,...

Git not removing files when switching branch

Sometimes when switching branches using Git (version 1.7.2.1) it does not seem to remove the files/directories I created specific to the branch I switched away from. Neither does it list it as untracked when running git status or any log entries for those files. This only happens occasionally and I'm not sure why or how to reset it so t...

Resolve selected merge conflicts using p4merge in GIT

Is there a way to resolve selected file having conflicts using p4merge in GIT? Lets say there are 25 conflicts and each conflict has to be resolved by each developer, if any developer runs 'git mergetool' the p4merge which is setup starts with the first conflict. this conflict maynot be related to that developers, so am searching for a ...

Keep git history when splitting a file

I want to take a function out of one file and put it into another, but keep the blame history. cp a.php b.php vim b.php # delete everything but 1 function vim a.php # delete the 1 function git add a.php b.php git commit But if I run git blame b.php I only see it blaming to this new commit. ...

Does GIT does the CRLF/LF conversion during commit or checkout(vi)?

I have a doubt now, does Git does the CRLF conversion during a commit or during a vi of the file? Let’s say I have some files in Windows with CRLF (not a Git repo), when I sync these files to a UNIX Git repo and do git add/commit with autocrlf true enabled, will these files get the conversion from CRLF to LF? Or does it do the convers...

git mv records move?

When invoking git mv file1 file2 does it record the move internally (for history tracking in the log) or is it completely the same as invoking mv file1 file2, git rm file1 and git add file2? ...

How to sign off a patch using git

Hi, I'm working on a project where some people will sent me git patches and I've to verify those patches and sign off the commits. We are creating the patches using git format-patch master --stdout > file.patch And the file is mailed to us, then we've to verify the patch. For this we creates a new branch and then applies the patch t...