git

Merging with "git mergetool"

I've found git mergetool to be a handy utility for merging diffs visually, but the way I'm going about it seems really wonky. Essentially, my process looks like this when conflicts are reported: Execute a git mergetool At the prompt, hit Enter to launch my diff tool (Meld or FileMerge, depending on which computer) Resolve the conflict...

Git: Rolling back a remote repository

I have a remote git repository, and I need to roll back the last n commits into cold oblivion. ...

Make git automatically remove trailing whitespace before committing

I'm using git with my team and would like to remove whitespace changes from my diffs, logs, merges, etc. I'm assuming that the easiest way to do this would be for git to automatically remove trailing whitespace (and other whitespace errors) from all commits as they are applied. I have tried to add the following to by ~/.gitconfig file b...

How do I do a 'git status' so it doesn't display untracked files without using .gitignore?

How do I do a 'git status' so it doesn't display untracked files without using .gitignore? I want to get modification status information on tracked files only. ...

Can I download a git repository without git?

I keep a lot of stuff in git repositories, out there on the net. The problem is that I often find myself on machines that don't have git, and where I also don't have root access. I don't necessarily need to commit changes back to the repo, just get the current master of the git project. Is there any way to download a git repo, without h...

Best practices for using git with CVS

What are your best practices and tips for using git to interface with a CVS repository? ...

git: how to squash the first two commits?

With git rebase --interactive <commit> you can squash any number of commits together into a single one. It's an OCD heaven. And that's all great unless you want to squash commits into the initial commit. That seems impossible to do. Any way to achieve it? Moderately related: In a related question, I managed to come up with a differ...

What git workflow to use for 2 non-co-located developers?

I've got a contract to write part of a program. The person writing the other part is in another city. I want to find a convenient way to send changes back and forth. For other reasons, I'd like to learn to use git as a distributed VCS and email changes back and forth. (I've worked with SCCS, RCS, and PVCS before, always with locking. I w...

Programmatic git status

Does anyone know of a git plumbing (definitely not porcelain) means of determining whether: there are edits in the repo since the last commit, and whether local HEAD is ahead of origin/HEAD I am looking to determine this programmatically, hence the desire to not solve this with porcelain and various sed-fu. ...

Is there any way to clone a git repository's sub-directory only?

I've got my git repo here: http://github.com/nicksergeant/finisht/tree/master Which, at the root, has two sub-dirs: /finisht /static When this was in SVN, /finisht was checked out in one place, while /static was checked out elsewhere, like so: svn co svn+ssh://[email protected]/home/admin/repos/finisht/static static Is there anywa...

Problems using git diff to create file list for deploy

I want to use something like the following command to create a tarball to deploy: tar cjvf ~/deploy.tar.bz2 `git diff --name-only 0abc 1def` The inner git diff command produces a list of files with relative including the relative path when i run it separately. I'm running into two problems though, I need to be able to auto escape sp...

how do you push only some of your local git commits?

Suppose I have 5 local commits. I want to push only 2 of them to a centralized repo (using an SVN-style workflow). How do I do this? This did not work: git checkout HEAD~3 #set head to three commits ago git push #attempt push from that head That ends up pushing all 5 local commits. I suppose I could do git reset to actually undo...

Sorting out a Git mess

I've just inherited a project which was maintained using Git. At one point, the code was deployed onto 3 separate systems and each system maintained their own decentralised Git respository. Each of the 3 systems extended the original base system in 3 different directions. None of the 3 systems have been synchronised against each other. ...

What documents should be stored in version control and how should they be stored?

I've found some similar questions (here, here, and here) asking about storing documents into version control. I have a more specific requirement and general question. The specific requirement is that I want to use Git. The more general question is, how should documents (for design, test, general practices, tips, etc, of a project) be sto...

Workflow and help with git, 2 svn projects and a single "workcopy"

Hello, I'm relatively new to Git, but I want to give it a try (vs SVN and Bazaar) Can anyone recommend me a workflow for a situation similar to the following: 1 SVN repo, with several projects 1 working copy "src" The ideea is that in "src" I need to checkout project A or sometimes project B. Both projects have several branches. F...

How to retrieve a single file from specific revision in Git?

I have a Git repository and I'd like to seem how some file looked a few months ago. I found the revision at that date, it's: 27cf8e84bb88e24ae4b4b3df2b77aab91a3735d8. I need to see what did one file look like and also save that to file. I managed to see the file using gitk, but it does not have an option to save it. I tried with command...

How does Git solve the merging problem?

SVN made branching much easier by making branches really cheap, but merges remain a real problem in SVN - one that Git supposedly solves. Does Git achieve this, and how? (disclaimer: All I know about Git is based on the Linus lecture - total git noob here) ...

What are your coolest/most unusual hacks using a distributed version control system?

I have been working with git for a few months and I find that most of the things that have transformed my everyday work for the better can be attributed to the flexibility and lack of enforced default policy in a distributed VCS. Quite a few people seem to have felt the same way and have built upon this kind of flexibility I have read...

Can I move the .git directory for a repo to it's parent directory?

I have two sub-directories each with a repo, thus : PPP/ |--ABC/ | |--.git/ | |--AAA/ | | BBB/ | | CCC/ | |--DEF/ | |--.git/ | |--DDD/ | |--EEE/ And would like to combine them into one repo, so, I would assume the directory structure would be like this: PPP/ |--.git/ |--ABC/ | |--AAA/ | |--BBB/...

Git and Team Foundation Server

Has anybody experience using Git as an offline solution for Team Foundation Server? For Subversion you could use git-svn to keep a private repository with a svn backend. I tried to use SvnBridge and git-svn to work with TFS. At first it looked promising but Visual Studio recognizes the solution as being under TFS version control and in...