git

Keeping two Git branches different by one file

I am certain two branches of my Git repo should only ever be different in a single file. The simplest way to ensure this is to do all work in branch1, and merge it into branch2 whenever I switch to it (wrapped into a shell script, so I only need one command per switch). However, is there a way to do this with even less work? ...

GitHub: Is it possible to collaborate with someone on a private gist?

I have a private gist. If I send the URL to a friend he can view it, but cannot edit it, unless he forks it. Is there a way to edit it directly without forking it? ...

Changing .gitconfig location

By default on Windows Git places global .gitconfig in c:\documents and settings\user\ How can I change that position so .gitconfig is stored in c:\my_configuration_files\? Can it be done at all? ...

Git - upstream + feature branches + release branches

I was using the rebasing topic branches workflow http://www.golden-gryphon.com/software/misc/packaging.html But because the local testers and admins don't like throwaway release branches, I need to move to a worklow with stable branches. The only one that is acceptable is merging workflow. Now the issue is that I don't know how to work...

git-archive vs. cp

What is the advantage of using git archive master/foo | tar -x -C ~/destination to deploy a copy of /foo vs. just copying from the the working copy with cp foo ~/destination/foo So, unless for some reason you don't want to copy everything over from that sub directory foo in master (or whatever branch you happening to be working o...

Git says local branch is ahead of remote after having pulled from remote

I’m sorry if the title isn’t clear, but this is a weird problem. I git checkout to my "stage" branch and git pull to get my partner’s latest changes (which he pushed last night to the "stage" branch on the remote repository), and sure enough, they merge to my local "stage" branch. git log <branch> shows five commits he performed last ni...

How do I check out what was in my git repository N days ago?

I have to check out my source code from two days ago. Whenever I have to do this, I have to look up the syntax. It's not in the git-checkout page. I'd like to have a convenient Stack Overflow question to refer to so I don't have to look it up every time. If this has already been asked, please point me to the dupe. :) How do I check ...

merging two git repositories, one a git-cvs clone, one git-svn clone

I am using code from a CVS controlled repository (@sourceforge). Instead of using it directly, I was using a git clone of it made by someone else. In my clone I have several modifications. In the meantime the upstream project has switched to SVN (@googlecode). I was able to create an automatically updated git clone of that myself. Now ...

Filtering git pushes

I'm looking to push my branch to a remote, but I don't wish to include all the files in the branch, but I do wish to keep track of them here. Is there a way to do this with a filter, or do I need to create a new branch for this? All the stuff I've read seems to talk about completely removing the files, I just don't want them pushed. A ...

Git workflow for a single developer on a local repository

I'm trying to refine a personal git workflow to something a little easier to deal with. Here's some background of how I'm using git for purposes of this post: A single developer who is the only one working on the repository. A single copy of the repository that is stored on the local machine. Only two branches "dev" and "master". All ...

`git-p4 clone` fails "new tip ... does not contain ..."

I'm runnining on Windows, with the windows p4 client, and git installed via Cygwin. The p4 client advertises how its syntax is regular across platforms and all that, so that should be hunky-dory. So when I go to git-p4 clone --verbose //depot/path/to/source, it lists out all the files in the repository as though they were being checked ...

How to include two different folders into the same git project?

Hey, i am working on two programs at the same time. Assume A and B are two different folders in different directories. Is it possible to have them both be a part of the same git project? Because i use data from A as input for B, but since A is a web app, i've put it in public_html while B is in a different folder. ...

Adding a Git subrepository to Mercurial

I've been trying to set up a project using bitbucket which has project dependencies hosted on github. Using the Hg-Git Mercurial plugin I am able to almost get there. But when it comes time to push, things become troublesome. The documentation for Mercurial subrepositories states: 2.4 Push Mercurial will automatically attempt ...

git stash and edited hunks

I totally love git add -p and git stash but I occasionally have the following problem, which is reproduced by the following sequence of commands: git add -p my_file: then I edit a hunk manually (using e) because the splitting that git suggests does not suit me git stash --keep-index: then I do some testing, and if the tests pass I do n...

Git's alternative to .hgrcpath

Does Git have anything like Hg's HGRCPATH, i.e. an enviromental variable which you can modify to change the location where Hg will search for its global configuration file. In git that can be somewhat accomplished by changing HOME, but that will affect unknown number of other applications, which is why I'm trying to avoid it. ...

Is there a way to keep two branches from merging in git

I would like to be able to keep two separate branches in a git repo that cannot accidentally be merged even though the branches may contain similar content. Is there a trick for forcing a branch to remain separate in git? That is assuming I have branch A and branch B, something like git merge B //assuming A is checked out would fail. ...

Changing lots of git commit messages

Apparently I mistyped my email a long time ago, whenever I was setting up git, and so my email has been incorrect in many repositories (I typed a 0 instead of an o). I sign all of my commits, so in almost every commit in every repo for years it's said signed off by: <[email protected]> instead of signed off by: <[email protected]>. Now I can't jus...

git push tag -> master

Hi, I am trying to accomplish something that is probably very simple, though I cannot figure out how, or what I'm doing wrong. So to get straight to the point: I want to push for example my tag 1.0.0 to my remote master branch. What I'm doing now is the following: git push production +1.0.0:master Yes, I want to force the push beca...

git stderr output can't pipe

I'm writing a graphical URI handler for git:// links with bash and zenity, and I'm using a zenity 'text-info' dialog to show git's clone output while it's running, using FIFO piping. The script is about 90 lines long, so I won't bother posting it here, but here's the most important lines: git clone "$1" "$target" 2>&1 | cat >> /tmp/gith...

Remove a file that I shouldn't have committed to Git

So I did a bad thing. Somewhere during the course of making a bunch of changes, I realized that a unintended file had snuck into a commit or two. Because I didn't realize this until later, the commits that included the file have now been pushed to the remote. I want & need the commits, I just want to remove this specific file from them....