git

Git Specific Messages in the file

In a file that I am using, I merged two branches one after the other to the master. So I had branch1, branch2 and master. First, I merged branch1 and then branch2. In the final version of the file in master, I am having a messages like <<<<<<<<HEAD branch2-messages ======== Branch1-message >>>>>>>> branch1 branch2-messages is the bran...

How to temporarily unbranch?

I started a feature branch B from branch A. Then I made some changes in both. Merging A into B and then B into A results in both heads pointing at the same merged commit (which is what I wanted because changes in A should also affect branch B). Now for a while only A will experience changes. Is there a way to make B stick to A until I c...

Git - Branching and a shared code base

Well, till now, I used common git operations like push, pull, commit and clone. But now, I need a git repo with different branches to test certain features but all these features require the same library which should be included in the repo. What's the best pratice to do this? ...

Does git gets installed in IBM/AS400

I have PHP on running on an AS400. Can Git be also be installed on an AS400? I'd like to use it to maintain version control. ...

git: check if pull needed

How to check whether the remote repo has changed and I need to pull? Now I use this simple script: git pull --dry-run | grep -q -v 'Already up-to-date.' && changed=1 but it is rather heavy. Do you know any better way? The ideal solution would check all the remote branches, and return names of the changed branches and the number of n...

Apply git .gitignore rules to an existing repository

Hi all, I started using git with an xcode project and have recently discovered that I can use .gitignore and .gitattributes files to ignore the noise from the compiler and system. Now that I have the .gitignore and .gitattributes files in place, how can I "apply" the new ignore rules and get rid of the crud from version control? My .g...

Best Git book for a noob

I am a complete noob when it comes to working with Git and Github. I have been using Subversion professionally for a few years. I am trying to decide between the Pro Git book or the Pragmatic Version Control with Git. Which is considered better? Should I just read both? Thanks in advance for your help. ...

Need a Perforce DVCS recommendation: git-p4, hg Perfarce, or Something Else?

We're getting migrated from Subversion to Perforce at work. I've been using git-svn and it's kept me very productive. I want to keep using a DVCS for my own development. Which works best with Perforce in your experience, git-p4, Perfarce (hg) or something else I've never heard of? What works well (and what doesn't)? ...

git post-receive-email hooks.showrev pretty formatting?

I'm trying to do this: git show --format=format:"parents:%p%ncommit:%h%nauthor:%an%n%N%n%s%n%b" -C; echo in my hooks.showrev in my post-receive-email script for git: custom_showrev=$(git config hooks.showrev || git show --format=oneline --abbrev-commit -C %s; echo) using the "standard" post-receive-email script. It just gives me th...

restore - git reset --hard HEAD^

Unfortunately I did several times git reset --hard HEAD^ losing a quite big chunk of code in several files. Is there a way to restore those commits or in this case to forward where the HEAD was before, so I can bring up those lines that I lost? ...

gitolite installation issue

Has any one tryied the easy install option of gitolite? I am trying to install gitolite from my windows (workstation ) to a solaris box. [command used to install] ./gl-easy-install -q git sjcfsap1 git The command breaks at the following place . *Y*ou are logging into system : [gitserver] cloning gitolite-admin repo... Initialized em...

Serving directory from webserver if its also GIT repo

If the correct security concerns are put in place, is there any reason to not serve a directory that contains a GIT repo of production code. The directory is a webroot of an application but if one uses say Apache to deny access to .git files would there be any reason to not do it this way? ...

With git how can i merge a repository that has already been merged?

I have a repository that i pulled the changes for, so now it is up to date with the remote repository. Except that now i realized that i needed to pull all of that repositories changes and keep none of mine. I want to go back in history so that i won't get an "Already up-to-date" when i pull. Also part two, how can i pull and get all of ...

Git "failed to push some refs to..." with custom Git bridge

I have been working on setting up a git server by using Paramiko to act as an SSH bridge for Git. I am able to clone my repository without issue, and even push changes up, however I get an annoying error message. Pushing to git@localhost:/pckprojects/heyworld Counting objects: 5, done. Delta compression using up to 2 threads. Compressin...

linux kernel "historical" git repository with _full_ history

I think many developers like to investigate sources with help of "git gui blame". As explained in 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 it needs to have special historical Linux repository for this purpose. I have looked a lot of the prepared historical repositories but I didn't found one containing changes from zero version so I giv...

Converting a Mercurial (hg) repository to Git on Windows (7)

I'm really quite frustrated at this point. I have an existing hg repository that has months of coding history in it, and I want to get this into a private Github repository so I can work on it from there. Unfortunately I use Windows and I can't seem to find any way to convert the repository that I can actually get to work properly. Pract...

Remedial Lesson on Git Trees

I've read and searched, searched and read, rinse, repeat, but a fundamental understanding of trees in Git continues to elude me (beyond the fact that they're loosely analogous to file system directories). They seem to be intrinsically linked to the index, but I just can't get the how through my thick skull. Blobs are easy, of course, be...

git: Can I stash an untracked file without adding it to the index?

A related question How do you stash an untracked file? was answered with "track the file." This doesn't work for my particular needs, however. I'm trying to stash everything that isn't in the index with git stash save --keep-index so that I can validate the index in my pre-commit hook. The idea is from the "Testing partial commits" exa...

git-commit-notifier with gmail

First of all you have to know I'm total Ruby noob :) I installed git-commit-notifier (http://github.com/ilozka/git-commit-notifier) on my system (Ubuntu 10.04) and followed all the installation instructions but every time I push to my git repository I get this error message: remote: Sending mail... remote: /usr/lib/ruby/1.8/net/smtp.r...

Checking out a project's first commit with git

Is there an easy way to find the SHA1 of the first commit in a project with a long history with git? ...