git

How to reduce the size of a repo on Github

I accidentally committed some large test wav files into my repository and they are using up a lot of space on my Github account. How can I remove these files from the history? Note: these files were committed some time ago and are not on the HEAD commit. ...

Git submodules workflow

In my project I need to use third party code, stored in several Git repositories. My project is also stored in (separate) Git repository. There are several people working with me on the main project, and I'm the maintainer. In earlier projects I used to copy dependencies manually to the Git working tree, adding a little file specifying ...

Maintaining a patch set for different branches

I'm in the position of generating a series of documentation patches each of which applies to more than one branch. The project uses Git for version control. The patches should apply cleanly on top of these branches as they are. What is optimal workflow for applying the patches to multiple branches with minimal effort? ...

What git gotchas have you been caught by?

The worst one I've been caught by was with git submodules. I had a submodule for a project on github. The project was unmaintained, and I wanted to submit patches, but couldn't, so I forked. Now the submodule was pointing at the original library, and I needed it to point at the fork instead. So I deleted the old submodule and replace...

git merge: keep one side for some files, manual merge the rest

In a merge with conflicts, is there a way to tell git to keep one version for a set of files? $ git checkout some_branch $ git merge origin/master $ ? ...

Make CRLF warnings go away,

I have setup git so it doesnt commit inconsistent line endings. The problem with that is a whole pile of files appear modified even though they are not. What do I type to make these files have the line endings fixed on the local side? # git checkout dev M src/au/policy/dao/EmailQueue.java M src/au/policy/dao/EmailQueueFactory.java M...

git & Cygwin - trailing whitespace causes "not uptodate"

Git on Windows w/ Cygwin is fraught with dangers. However there's one that's really starting to bug me. It's related to the core.autocrlf=true behaviour. After spending a week trawling the 'net it became clear that the problems you'll encounter are less bad with this set. However, if a file has a line with trailing whitespace on the end...

Git and Mercurial - Compare and Contrast

For a while now I've been using subversion for my personal projects. More and more I keep hearing great things about Git and Mercurial, and DVCS in general. I'd like to give the whole DVCS thing a whirl, but I'm not too familiar with either option. What are some of the differences between Mercurial and Git? Note that I'm not trying t...

Is there a single server I can use to store/manage version control for SVN/Git/Hg/etc?

Is there a single server I can use to store/manage repositories which could then be accessed by the common/modern open-source (D)VCSs such as SVN, Git, Mercurial, bzr, etc and still keep a good level of compatibility with all of them? We have a large number of users on SVN, some on Git, and a couple using mercurial but none are using an...

Is there an easy way to change to previously active branch?

I'm using git (in fact, msysgit) 1.6.4 on Windows. Most of the time I'm doing work in some feature branches. Every now and then, I want to hop back to master to cherry-pick one particular commit I did in my feature branch - usually because it's a useful bugfix which makes sense even without the feature. My workflow is like this - if this...

GIT workflow w/ multiple workstations and a centralize server

Ok, a few things I'm not quite sure about. For starters: I have a "bare" repo on a VPS in a remote DC. I have a workstation at work that I also code on. I have a workstation at home that I also code on. 1 - When I set up my initial repo on one of my workstation (i think Git calls this the master), should I check out and work from a...

How do YOU deploy cron jobs to production?

How do people deploy/version control cronjobs to production? I'm more curious about conventions/standards people use than any particular solution, but I happen to be using git for revision control, and the cronjob is running a python/django script. ...

git - ignore files based on mode

I want to ignore executable files that do not have an extension For example: gcc -o foo foo.c I know I could add 'foo' to my .gitignore file, but if I decide to change the name of the executable I would need to update my .gitignore file... ...

SSH - ksh: git: not found

I have GIT running on a Solaris server. From a windows machine I installed cygwin to try to clone a repository hosted on the server. I do the following: $ git clone username@server:project.git ksh: git-upload-pack: not found So I try $ ssh username@server echo \$PATH /usr/bin It seems like git is not in /usr/bin/ but in /usr/lo...

Workflow best practice with git and github?

I have been using git and github with my small team of developers for our projects. I can't help but think that we aren't doing it right. I am interested to hear how others use this workflow within their projects. How we use it: We branch before each change, merge back into the master, commit locally and push to our github repo. We then...

recover lost unversioned files after git clean -d -f

I have the feeling the answer to this question is no but I figured I would ask anyways. Long story short I accidentally did a git clean -d -f on a branch and lost about 20 files that I needed. These files have not been committed so as far as I know git shouldn't know about them. Is there any way I can get these files back? ...

Problem with git on windows ... pushes don't complete/timeout

Git works fine on my dev box, but ever so often, I'll go to push something to the repository and it will go through the motions like its actually pushing, but then it will get stuck like this $ git push origin master Counting objects: 9, done. Delta compression using up to 2 threads. Compressing objects: 100% (5/5), done. Writing obje...

Git nested repos

I have 2 repos, A and B and I want to nest B inside A (add it as a sub folder). I just placed B inside A, but the problem is that when I do any modification on repo B, it's not added or even considered in Reop A. What change or modification should I do to make it considered as repo A? Considering that repo A is private and repo B is pu...

git - changed file summary like svn diff --summarize/svn status from console (no gitk)

svn diff --summarize shows the changes at the file level for a commit. Output it something like: M modified-foo.bar D deleted-file.bar A new-file.bar Similar to svn status, but for commits. I would be happy with output similar to git status, but for a particular commit instead of the working copy. I know I could fire up gitk...

Git setup for non-developers

I'm trying to introduce git at work, and to do that I want to maximize team buy-in. This is not a problem for programmers (we're usually delighted to learn new stuff like this) but it is a problem for designers and content managers who commit static content like html, css, etc. They can barely use Subversion via TortoiseSVN, so I need ...