git

Git hook output - where to see/find

I'm trying to get a git commit email hook running using Git on Windows. I'm sure I've got my copy of contrib/hooks/post-receive-email (placed in the project's .git/hooks/post-commit) script messed up, or I'm missing an important node in my config, but I don't know where I would see any error messages. Would they be echoed to stdout when...

git: How do you check out the initial version of a file in a git repo

I'm wondering if there's a better way to check out the initial version of a file than the obvious way: git log --reverse [path/to/file] copy the first sha1 git checkout [found sha1] [path/to/file] We've got HEAD for the most recent, and the ^ suffix for going back one(or more) but I've not seen any good way to go back to the beginn...

How to find commit SHA1 of a tree containing a file containing a given string

This is the situation: I've lost some work in my git repository, this work was once commited, but is now burried in my history, somewhere that might be unreachable by 'git log --all'. The only thing I've can remember is some distinct string that could pinpoint a file that is part of my work at this time. I've got a solution... but it is...

Using git-svn to make remote branches

I'm trying to make a branch on the remote subversion server, using git-svn. I've made a git branch (namespacing) but when I tried to git svn dcommit it just wrote to trunk! After cleaning that up I'd like to know how to make a branch on the remote, and then how to commit to that. ...

How do I share single files between multiple branches in git

I have a repository that contains the software in branch master and its homepage in branch gh-pages. The project contains an examples directory with source files that should be contained in the master branch. The homepage should contain the compiled examples and possibly also the source files. How can I share the examples (that depend on...

How can I do this with Git...

Hi Guys, We are migrating from HG to Git. Our set up is like so: Dev locally, commit and push the code to our dev server and test, then we take the code on dev and put it on prod. So, : local -> dev server/staging -> production server How we do this with HG is the following: From local to devserver hg commit -m 'stuff' hg push ssh:/...

how to view/edit a git remote branch

Hi I'm completely new to git, but I have experience with SVN. All the tutorials assume that one knows how to view/edit a file when using git, but I'm confused. I cloned a repository (from someone who needed to share code with me), then checked out several remote branches to local branches. Now I want view the code (it's Java). I can't fi...

Fix msysGit Portable $HOME location

I have successfully installed and configured msysGit Portable on my flash drive, and have used it to pull and push GitHub repos. However, I seem to always have to kludge the SSH support. Specifically, in order for SSH to find my key files, I have to follow these instructions to start a second instance of ssh-agent and then ssh-add my ke...

make sure files are converted CRLF into LF in an update hook- is there a performance hit?

There had been a lot of discussions about the core.autocrlf and core.safecrlf features in the current release and the next release. The question i have here relates to an environment where developers clone from a bare repository. During the clone the autocrlf settings are enabled. But since the developers has full control on their clon...

Git repository inside another git repository

Hi people! I have the following directories structure: g1/ .git a b c/ .git d e As you can see, I have de repository "c" inside repository "g1". When I use the following command: git clone g1 g2 I only get the following directories structure: g1/ .git a b c/ The directory...

is 'git add' necessary when trustExitCode = true ?

I know that I should use git add after the conflict is resolved. I've recently noticed the trustExitCode option for mergetool. When the selected mergetool returns good exit code do I still need to use git add ? ...

Fatal error with `git rebase upstream-branch` in topic branch

I have an issue when I try to rebase an upstream branch into a topic branch. The workflow is like this: git checkout upstream git pull origin upstream git checkout topic git rebase upstream The result looks like this: First, rewinding head to replay your work on top of it... Applying Refactored database access and added logging error...

Git: Removing a folder with \r in the path

So somehow OS X allowed me to create a folder with the name "assets\rassets\rassets". Yep, those are \r linebreaks. Now I've renamed it, but git can't find it to remove it. git rm "assets\rassets\rassets/default_app_icon.psd" fatal: pathspec 'assets\rassets\rassets/default_app_icon.psd' did not match any files All combinations of esc...

problem with cloning git repository

Hi All, I am trying to host a git repository. Googling around found this tutorial regarding hosting git repositories. But things didn’t go well :( I am using Ubuntu 10.04. IP: 192.168.0.131 Openssh running on port 22 It was going good till setting up gitosis-admin repo. Here is what I did. I generated public key on this host linux ...

How can I completely remove a file from a git repository?

I noticed recently that the project files my text editors use (along with some other junk) got added the git repository for the project. Since they aren't actually part of the project, I'd like to remove them, but git rm doesnt remove the old versions from the repository, and I couldnt find anything else that looks promising. ...

How do I stop git from committing unchanged files?

My coworker has an issue where his commits keep including every single file in the repository instead of just the changed ones. The file contents are literally identical, but the changeset in our private Github repository shows all of the previous version's lines removed and all of the "new" version's lines added, even though there was a...

Git using non-standard .vimrc?

I've noticed that git seems to use different vim settings any time I'm writing a commit message. I have the git+svn install off Macports, and I've checked the $MYVIMRC variable: it's set to the correct file. Still, every time I go to commit a message I have a restriction on 80 characters per line, case sensitive search, and none of the p...

How do I sync a git repository to subversion?

We use several open source libraries that are hosted on github. I want to be able to clone the git repositories and basically push them into our local subversion repository so I can start a CI build internally for them. How do I set up the connection to the svn server in a git repository that I cloned from github? I understand how to cl...

How to remove a commit in git that has no specified branch?

I have the following git repo structure: a-b-c-d-.. [master] \ x The commit x was accidentially done (can't figure out how) and has no named branch. How can I delete this commit? For detail, git log shows this (Translated back from german, sorry for any inconvieniances): Author: ... Parents: 8444.. Branch: Follows up: Prece...

git workflow: everyone has a branch, or everyone has a master?

When working with multiple people with git, is it better (1) for everyone to just work in master, and merge between each other's masters, or (2) for everyone to work in their own titled branch? As I see it, in the case of (1), although each master acts as a branch, everyone is expected to merge between each other's work with a mostly li...