git

Capistrano occasionally fails to pull git repo

Capistrano sometimes fails to pull the newest source from github, but shows no errors. On several occasions now, cap deploy did not pull the latest code from my git repo, but showed no errors in the process. Repeatingly running cap deploy does not fix the issue, but running git pull origin master on the actual server does pull in the n...

Enforce no merging while staged changes exist in git

I want to enforce (i.e. throw an error and fail) whenever I do a git merge with staged changes. Much in the same why a git rebase will not work if unstaged changes exist. Is there a way to do this? The goal of this is to enforce a workflow like: git stash git pull #or git merge git pop ...

Git checkout file - casing in file name

Hello! Git newbie here :) Faced casing-related problem: file aspnetdb.mdf was removed from repository several commits ago, I decided to restore it from some of earlier commits and did it is such way: git checkout master~3 aspnetdb.mdf wanted to get file from 3rd back commit But git said, that there was no such file. Then I exe...

How should I use git submodules to share code between Heroku apps?

I have a few Rails 3 apps deployed to Heroku that need to share some business logic. Apparently, although Heroku's Bundler support is pretty solid, it can't yet pull from a private Github repo. So instead I'm building a couple of gems, vendoring them into each app, checking them into git, and pushing them up with the rest of my code. Th...

Bundling version control software with product

Hello, I was wondering if its possible to bundle version control software with a product, so customers can use it to version control the configuration files required for the final product to run. So far, searching has only given me pointers to using SVN/Git etc. for versioning source code within an organization. Are there any examples o...

Cleaning remote Git branches

I have moved an SVN repo to Git and probably due to a number of clonings, I'm now left with a bunch of branches that look like BranchA origin/BranchA remotes/BranchA remotes/origin/BranchA remotes/origin/origin/BranchA i.e. the same branch is listed a number of times. How can I clean this mess up. There are > 50 branches, some are not...

Setting git parent pointer to a different parent

If I have a commit in the past that points to one parent, but I want to change the parent that it points to, how would I go about doing that? ...

git format patch limit?

I am trying to cherry pick some commits in my repo but it keeps on failing. (I tried this tutorial on SO: "What is the best way to git patch a subrange of a branch?") So I did a workaround: just do a git format-patch of the commits and just delete the extra files. Really dirty stuff, but a bit easier to do. So I do a git format...

Messing with GIT history destroyed recent commits...how to recover?

So. I'm new to git. And I think I may have broken something beyond my ability to repair (hooray). Here's the breakdown: I made a remote directory, and accidentally included some VERY large files in the initial commit. This made it difficult for people to do anything with it. (I didn't realize at first, and had made modifications, an...

Maintain continuity in Git repo when a file's name changes

I have a codebase of Javascript files that I use to drive a Web site. To synchronize the many files in deployment, I name the files with an appended version number. I have a "master" file that contains current version numbers for the different components. This is used to generate the script tags in the HTML file. I have the codebase se...

Funny markers in 'git log -p' output

I did a 'git log -p ..origin/xxxx' and got markers such as: '-<<<<<<< Updated upstream' and '->>>>>>> Stashed changes', what does it mean and where is it explained? ...

git problem : fatal: Unable to write new index file

I have an existing project that has been managed under git. I recently had to do a ground-up rebuild of the computer (OS X Snow Leopard), and returning to the project, git can track the changes in the project, but I can't save anything to git. I get the error in the title when I try : Dans-iMac-335:[app-name-obscured] apple$ git add app...

Git commit date

Other than parsing git log for the date string, is there a Git native way to report the date of a certain commit? ...

Lazy Git repository updater

I'm using Git as the repository for my hosted-server web application. I know the way you're supposed to use a local repository with a remote project is to copy each file you edit to your local machine and add it to the repository to keep changes up to date. My question is: If I usually edit or create lots of new files every day, is th...

How can I safely use git rebase when working on multiple computers?

I work on the same project on two different computers, desktop and laptop. Sometimes I need to transition between them while in the middle of some task/feature. So I want to make a commit on the laptop, and then transport (push/pull) it to the desktop and continue. Then, when the feature is complete I want to make a new commit and then ...

Restore a previous git commit?

Apparently some old bug fix commit of mine got dropped during a recent merge of old branch into new. I found the commit in the logs and have the ID (403357cab89465ce68001762d35fe27b57aeec65). Now I just want to restore that commit to the current working branch so I can firstly diff those changes but likely commit them all in again. Ho...

git: Apply changes introduced by commit in one repo to another repo

I have a repo1 and repo2 on local machine. They are very similar, but the latter is some kind of other branch (repo1 is not maintained anymore). /path/to/repo1 $ git log HEAD~5..HEAD~4 <some_sha> Add: Introduce feature X How to apply changes made by commit <some_sha> in repo1 to repo2? Do I need to prepare some patch, or is it possib...

Is the full path required to unstage a file in GIT if am currenlty under a sub-directory?

Repo: mergetest $pwd /gitvobs/mergetest/apple $git status On branch br1 Changed but not updated: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) **modified: inside** $git checkout inside error: pathspec 'inside' did not match any file(s) known to gi...

How to create a svn branch from local git branch?

I am using git version 1.7.2.3 and I have the following situation: Clone git repo from svn | * * (<= commits to master & corresponding commit to svn) * * | master (points to svn HEAD) | |___ my-branch (no equivalent svn branch) | * * (multiple commits to this branch) * * ...

Setting up Git Server on Windows With git-http-backend.exe

Hi all, I am in the process of setting up a Git server (1.7.2.3) on a WS 2008 machine using Apache and git-http-backend.exe. I have been following a good tut here. I have the GUI working, I can annoymously clone and if I put the following in the config of a repo I can annoymously push: [http] receivepack = true I have added the fo...