git

Exporting files from hook in bare git repository

So, my situation is the following: I want to maintain my website using emacs-muse mode. For transferring the website (and version control), I want to use git. So I would create a hook in the remote (bare) repository that automatically copies the HTML subdir to the web directory. How can I do that from a hook? Also note that the whole dir...

What's the difference between ".." and "..." in Git commit ranges?

Some Git commands take commit ranges and one valid syntax is to separate two commit names with two dots ("..") and another syntax uses three dots ("..."). What's the difference? ...

Is it possible to have a subversion repository as a git submodule?

Is there a way to add a subversion repository as a git submodule in my git repository? Something like: git-svn submodule add https://svn.foo.com/svn/proj --stdlayout svn-project Where https://svn.foo.com/svn/proj points to a subversion repository. I know there is git-svn which allows one to interact with a subversion repository. So I ...

How are you structuring your Git repository workflow?

We've seen and watched the videos on how large distributed teams are using Git, but what about those of us who aren't distributed and who work in the office with the rest of our team? How should we be structuring our repository(ies) and our workflow? Think about the traditional office which has been using Subversion or CVS as the singl...

Git branches with completely different content

Since Git has the ability to keep track (and keep it clean) of branches with completely different content from each other, in the same repository, some projects (like Git itself) have started to make use of it. Git, for instance, uses one branch for the code itself, while keeping its documentation in a separate branch. Same repo, just d...

Show ignored files in git

I am getting my feet wet on git and have the following issue: My project source tree: / | +--src/ +----refs/ +----... | +--vendor/ +----... I have code (currently MEF) in my vendor branch that I will compile there and then move the references into /src/refs which is where the project picks them up from. My issue is that I have my .g...

Git - best practices (in general, and from a perspective of former SVN user.)

Hi, Recently I have learned the basics concepts of Git. We did use a bit of git-svn to get familiar with using it. I would like to start my first "true" project on git along with my friends. Therefore I would like to ask you what are the best practices of using Git in general, and if there are any pitfalls that SVN familiar developer m...

git log output like svn ls -v

Is there a way to make git give me output like svn ls -v does. Basically a list of each file and who last edited that file? Like this: filea.txt Someone Else fileb.txt Another Person Maybe even with the SHA to identify the commit the change happened in? ...

A Regex to match a SHA1

I'm trying to match SHA1's in generic text with a regular expression. Ideally I want to avoid matching words. It's safe to say that full SHA1's have a distinctive pattern (they're long and a consistent length) - so I can match these reliably - but what about abbreviated SHA1's? Can I rely on the presence of numbers? Looking at the S...

Suggestions for Grails .gitignore

So far i've collected the following: *.iws *.war .classpath .DS_Store .project .settings /*.launch /*.tmproj /out/** stacktrace.log test/reports Any other suggestions? ...

git: switch branch without detaching head

I have a repository on github with a main branch (master) and a branch for some experimental work. I made some commits and pushed to the experimental branch and everything was fine. Now, on a different machine, I try to clone my repository (git clone repository) and then switch to the experimental branch (git checkout branchname) but e...

When using git, how do you push the exact working directory to a remote?

I have a a remote git repo and a local clone. Let's say I lose my local .git directory and subsequently add and remove some files to the local working directory. At some point, I want to re-init the local repo, connect it to the remote, and ultimately push my local working dir to the remote exactly as it is (which is to say, I want to h...

How do I ignore a directory in the root of my git repository, but include it further down in the tree?

I need to use .gitignore to exclude a directory in the root of my repository. However, other directories with the same name exist deeper in the directory tree, and I need those to be included. It seems that when I put the name of the directory into .gitignore, it catches all of these directories, not just the one I need to ignore. I u...

Using Git For Community-Oriented Website Content Revision System

I'm working on a Django-based web app in which the community fuels the content on the site, much like a wiki. Content is in the form of HTML, and users have total freedom to fork articles/chapters or make their own modifications to existing ones and add them to the current 'working version'. The maintainer of each article/chapter (the or...

How do you get git to ignore all contents of a directory?

I have a git directory which contains the a whole bunch of files and then has a directory called 'sessions'. 'sessions' contains cookie information for my web.py program. I need the folder 'sessions' to remain in the git repository because without the folder the program does not function correctly. I don't need the actual contents of f...

How do you deploy from svn when your original repository is in Git

My team develops using Git, making good use of many of its features. We are measurably more efficient at using git that svn. However our current client want us to deploy code from an svn repository, which means we are required to somehow regularly move our code from git to svn. At the moment we are maintaining a directory that is both...

Git Best Practice: How do you tag a revision "TESTED" or "REJECTED"

I would like to tag certain commits as "tested" or "rejected" depending on the success of certain regression tests (similar to clearcase labels) Regression testing itself is not automated (these are long running tests unfortunately). However, I'd like to have a warning when attempting to checkout old commits that have been rejected o...

How to realise a deployment branch in Git

I'm using git for a PHP project, I think it's really handy. There is one thing that would be great if I get it to work. I have created a branch, meant for deployment. It has some differences, like different configuration files and documentation. I can't just ignore them, because then they will stay in both branches, while i would like ...

How do you organize your git repositories?

"Traditional" version control systems follow a "Cathedral" model -- all the code is stored in one main repository. Distributed Version Control Systems like git allow a lot more flexibility in organizing your multiple repositories. You can "push" changes, "pull" changes, and "clone" repositories. Have you organized your repositories al...

Can Emacs ignore change of timestamp of git stashed file?

I have written a small function in Emacs that does a git stash git stash apply in the Git repository of the file I visit, and I have added this function in after-save-hook so it runs every time I save the file. The problem is that when I save the file, the git commands above run and change the timestamp, so Emacs thinks that the file...