4
голосов
2ответов
315 просмотров

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 f...

1
голосов
5ответов
270 просмотров

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 co...

521
голосов
11ответов
40177 просмотров

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 Merc...

1
голосов
1ответов
1547 просмотров

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 ...

50
голосов
6ответов
51704 просмотров

Make Git "LF will be replaced by CRLF" warnings go away

I have setup Git so it doesn't 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 ...

25
голосов
1ответов
12033 просмотров

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 $ ?

12
голосов
9ответов
5366 просмотров

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. ...

4
голосов
1ответов
1238 просмотров

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 bran...

42
голосов
2ответов
6209 просмотров

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 work...

8
голосов
2ответов
4979 просмотров

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.

4
голосов
4ответов
1100 просмотров

How to change case of a file in git under cygwin?

We work in a mixed case sensitive/insensitive environment (cywgin/linux), and today someone created a small havoc in our workflow by renaming a file, changing an S to an s. This caused all sorts of interesting merge issues across branches, and to be quite honest no-one's entirely sure of what hap...

1
голосов
2ответов
1726 просмотров

Making Teamcity clone a git repository

I have a build process that relies on git-describe so I want TeamCity to clone the repository instead of only putting the source without git into the /work folder. I'm using the JetBrains Git plugin, is there another plugin that does that or should I just write another script that does a git clo...

4
голосов
2ответов
588 просмотров

Is it better to use a separate commit message for a git merge?

I come from an SVN background so I'm not sure what the typical git workflow looks like. When you merge in SVN, you provide a commit message describing the merge. This is necessary because SVN's merge-tracking has historically been poor. I noticed that git's default behavior is to automatically c...

197
голосов
14ответов
293417 просмотров

Configuring Git over SSH to login once

I have cloned my git repository over ssh. So, each time I communicate with the origin master by pushing or pulling, I have to reenter my password. How can I configure git so that I do not need to enter my password multiple times?

5
голосов
2ответов
3675 просмотров

How to get a list of all blobs in a repository in Git

How can I list all versions of all files in a git repository? (For example for listing all files that ever contained a certain string) This list could be used to cat the file.

7
голосов
3ответов
2238 просмотров

Local commits pushing to a central server

At work we use perforce and are encouraged to make regular commits to it (something I am fine with). However, I'd like to run something like mercurial so I can locally commit stuff that is work in progress and doesn't necessarily compile/run and then from this do my regular commits to the central...

16
голосов
2ответов
3428 просмотров

Can git format patch so it can be used with patch program?

I'd need to create simple patches from git repository that can be applied with plain simple patch command line utility. Can it be done?

30
голосов
2ответов
14315 просмотров

How to make part of an existing Git repository a submodule

I have this Git repository which contains two folders: binary-search and poker. For example: https://github.com/soulnafein/code-katas I would like to turn these folders into submodules and keep their change history. How can I do that?

51
голосов
6ответов
16183 просмотров

How to programmatically determine whether the Git checkout is a tag and if so, what is the tag name

In a Unix or GNU scripting environment (e.g. a Linux distro, Cygwin, OSX), what is the best way to determine whether the current checkout is a Git tag. If it is a tag, how can I determine the tag name? One use of this technique would be automatically labeling a release (like svnversion would do ...

284
голосов
20ответов
116913 просмотров

How to programmatically determine the current checked out Git branch

In a Unix or GNU scripting environment (e.g. a Linux distro, Cygwin, OSX), what is the best way to determine which Git branch is currently checked out in a working directory? One use of this technique would be automatically labeling a release (like svnversion would do with Subversion). Please a...

15
голосов
1ответов
3536 просмотров

Need to handle git-submodules in git-archive

I need to pack git submodules inside of tarball which I create with git-archive. I see that in 1.6.5 git-archive does not support git submodules. I see several scripts to handle this case in the net, but I'm not sure which one to pick. What is the best / most official way to do this?

2
голосов
1ответов
1572 просмотров

Git Web Interface

I am trying to make the viewgit interface work for my projects. However I am running into this curious issue with PHP exec: These 2 unix commands work from inside my viewgit/ directory: /viewgit-> GIT_DIR=/usr/local/apache2/htdocs/repo/.git git rev-list --header --max-count=1 c19e231ad8741...

110
голосов
3ответов
18268 просмотров

Reset other branch to current without a checkout

I'm writing some scripts for my Git workflow. I need to reset other (existing) branch to the current one, without checkout. Before: CurrentBranch: commit A OtherBranch: commit B After: CurrentBranch: commit A OtherBranch: commit A Equivalent of $ git checkout otherbranch $ git res...

5
голосов
4ответов
11738 просмотров

git-clone memory allocation error

I'm trying to run git clone and am receiving the following error: fatal: Out of memory, malloc failed fatal: index-pack died with error code 128 fetch-pack from '[email protected]:git' failed. I was able to successfully do a clone on my local machine, but it's failing when I try to clone to another ...

7
голосов
5ответов
2251 просмотров

Using git as a centralized version server

I currently use svn at work. Our setup is: everyone has a working copy and we commit to a svn server served by apache2. So I commit changed, the other update, and everyone can work on the copy as they wish. So it's pretty easy to deploy. But now, I'd like to do the same thing but with Git. Wo...

2173
голосов
14ответов
852727 просмотров

How do I show the changes which have been staged?

I staged a few changes to be committed; how can I see the diff of all files which are staged for the next commit? I'm aware of git status, but I'd like to see the actual diffs - not just the names of files which are staged. I saw that the git-diff(1) man page says git diff [--options] [--] […] T...

4
голосов
3ответов
152 просмотров

how to identify branches that need to get merged in git

I make a lot of bugfix and feature branches and in the end merge them all into a release candidate (rc). but when i test the rc I am not sure if i have merged in all the branches. How can I find out which branches are missing? I tried gitk, but it seems it shows only the branches that are alread...

17
голосов
4ответов
12420 просмотров

Converting svn to git, how to get the branches not to be just remote in the svn repo?

I'm quite new to git and I'm trying to move a svn repository to git. I followed the guide below so now I have a git repo on my server http://pauldowman.com/2008/07/26/how-to-convert-from-subversion-to-git/ So, if I do "git branch" git replies "* master" and if I do "git branch -r" i get a list o...

2
голосов
2ответов
1231 просмотров

How to "freeze" git submodule

I'm using a few repository which I do not host myself and I thinking what if I deploy my application while they are not available? This simply just can't happen. Is there a way to "freeze" the submodule somehow that when I pull from my repository the submodules are already init and update? Any ...

22
голосов
3ответов
7695 просмотров

What are git's thin packs?

I haven't found much on thin packs, and the man pages' information is rather cryptic about this. I know it has something to do with slow connections, but what would be a "slow connection"? What are its pros and cons? When should I use it, when should I not use it?