git

git update hook: Finding all revs being committed

I'm creating an update hook so that our central git repository can do some simple sanity checks of each file in each commit. However, I don't know how to make git cough up the names of all of the commits in a "push". No matter how many commits the client is pushing, the update hook is called just once (by design). For example, suppose...

How would you use version control for personal data, like a personal website?

This is more a use-case question, but I generate static files for a personal website using txt2tags. I was thinking of maybe storing this information in a git repository. Normally I use RCS since it's simplest, and I'm only a single user. But there just seems to be a large trend of people using git/svn/cvs/etc. for personal data, and I ...

Recover from inadvertent skip during rebase

I just tried to rebase a very old branch with a minor modification onto my master. There was a problem with merging just one of the three files involved, so I did an unthinking --skip, thinking that it would just skip that file, but as it happened, it seems to have skipped all my changes, and rolled forwards. So now the rebase is finishe...

gitosis-admin git push failed, exec hooks/post-update

I'm following this tutorial After this step: $ git commit -a -m "Allow jdoe write access to free_monkey" $ git push I always failed, with this error: fatal: exec hooks/post-update failed. This is from my /home/git/repositories/gitosis-admin/hooks/post-update: -rwxr-xr-x 1 git git 83 Mar 10 11:49 post-update So I change gitosi...

git: Your branch is Ahead by X commits

How does this actually come about? I am working in one repo by myself at the moment, so this is my workflow: 1- change files 2- commit 4- repeat until satisfied 4- push to master Then when I do a git status it tells me that my branch is ahead by X commits (presumably the same number of commits that I have made). Is it because when yo...

How to change a remote repository URI using Git?

I have a repo (origin) on an USB key that I cloned on my hardrive (local). I moved "origin" to a NAS and I successfully tested cloning it from here. I would like to know if I can change the uri of "origin" in the settings of "local" so it now pull from the NAS, and not from the USB key. For now, I can see two solutions : - pushing ever...

Git clone using ssh - can't find repository

I'm trying to setup a Git server on Windows 7, using CopSsh, PuTTY and msysgit. I'm having problems cloning a repository using ssh. If I use a regular directory path, it works: $ git clone ~/vc/git/depot/test.git/ /c/dev/es/app Initialized empty Git repository in c:/dev/es/app/.git/ warning: You appear to have cloned an empty reposito...

Best practice: git, github, lighthouse and 2 developers

I'm setting up a new project and plan on using git and github for sourcecontroll and hosting of repo and lighthouse for bugtracking. I've been working with git for some while now, but only been using it for more of a backup solution than collaborate coding solution. [Edit]Reade here for more details: http://git.pastebin.com/ArzBBx6j [/E...

git pull not working

I am not using github. We have git setup on our machine. I created a branch from master called experiment. However when I am trying to do git pull I am getting following message. > git pull You asked me to pull without telling me which branch you want to merge with, and 'branch.experiment.merge' in your configuration file does not tell...

Can I change the default directory on my local drive for all Git activity?

So I just started using Git and GitHub. It's still a steep climb, but I'm starting to enjoy it. One thing I've noticed from when I clone a repository is that it always downloads to my home folder /users/username. Is there a way to change this? I went searching through the Git manual and thought I might be able to use --git-dir=GIT_DIR, ...

How do you share your git repository with other developers?

I have a central git repository that everyone pushes to for testing and integration, but it only is pushed to when features are 'ready'. While in the middle of a big task, developers frequently have many commits that stay on their harddrives. Sometimes in the middle of these projects I'd like to either see what another developer is doi...

Git - switching between branches in the middle of work

For various reasons (code review mostly) I need to switch from current development branch to other branches quite often. Currently, I use either 'git stash' to shelve the uncommitted changes, checkout other branch, then switch back and do 'git stash apply' However, sometimes I'd have some newly added files there, which are not tracked....

Why does Git display certain new folders when checking out old revisions?

Hey all - I'm still learning the ropes of Git (love it!) but the other day I noticed some behavior I just do not understand. We have, in essence, three folders that got moved into the repository at different times (one immediately after we created the repo, one a little while later, and one just recently). Recently, I had to get some cod...

Git merge command

I'm reading the following article: http://github.com/guides/keeping-a-git-fork-in-sync-with-the-forked-repo, where they mention essentially pulling in changes from two repos at the same time by creating the following alias: pu = !"git fetch origin -v; git fetch wycats -v; git merge wycats/master" This makes sense, but, as someone new ...

msysgit - sh.exe - fork: Permission denied - Vista 64 bit

I installed msysgit on other Windows machines with no problems. On this Vista 64 bit Ultimate box, I installed the 3 most recent versions of msysgit. On all three installs, when I do a "git bash here", I get exactly this on the command window: sh.exe": fork: Permission denied sh.exe"-3.1$ The git command doesn't work. I get the sam...

Git branch unknown to local clone

I have a git repository with two branches. If I clone my repo I can only see the master branch. I have both branches up to date. The problem is I don't fully understand merging and branching. Darn it! My example can be seen here: http://github.com/rimian/rimian/network Can anyone tell me how to get this back to normal? ...

Git. Checkout feature branch between merge commits

Hi all It's kind weird, but I can't fulfill a pretty common operation with git. Basically what I want is to checkout a feature branch, not using it's head but using SHA id. This SHA points between merges from master branch. The problem is that all I get is just master branch without a commits from feature branch. Currently I'm trying t...

How do I make git post-receive emails be sent from the commit author?

I'm using the post-receive-email script included with git. (Source is here.) It works just fine, but I want each email to be sent from the author of the commits pushed. How do I do it? My post-receive file currently looks like this, and I want to customize the from-email-address. #!/bin/sh export USER_EMAIL=from-email-address@blah....

Git rebase and semi-tracked per-developer config files.

This is my first SO question and I'm new-ish to Git as well. Background: I am supposed to be the version control guru for Git in my group of about 8 developers. As I don't have a lot of Git experience, this is exciting. I decided we need a shared repository that would be the authoritative master for the production code and the main mee...

How can I determine if a given git hash exists on a given branch?

Background: I use an automated build system which takes a git hash as input, as well as the name of the branch on which that hash exists, and builds it. However, the build system uses the hash alone to check out the code and build it -- it simply stores the branch name, as given, in the build DB metadata. I'm worried about developers a...