git

GIT, When pushing code to production, should I create a branch or?

I want to somehow tag the codebase when I push it to production, so that next time when I want to push to production I can do a diff and see exactly what files changed since the last time. How can I do this with GIT? Also, how can I list all production builds? ...

Git analog to Hg's Bigfiles Extension?

I want something in git that is similar to Mercurial's Bigfiles Extension (note: I know of git-bigfiles, but that is unrelated). Basically I want to store large binaries in my git repository, but I don't want to get every version ever of the large binary when I do a clone. I only want to download the large binaries when I checkout a spe...

Will the fix to correct line-endings in Git repositories make future "diffs" useless

So I've run into this issue. First of all, the GitHub page seems to indicate that this only affects Windows machines. Is that true? I'm experiencing the problem when doing a fresh clone of a migrated repo on OS X. Secondly, if I do what is suggested in this fix, I end up modifying thousands of files. The problem is that when I look at t...

git count files in the staged index

I'm trying to figure out how to easily count the files in my uncommitted index. I've tried: git status | grep '#' | wc -l but there are a few lines that start with # that don't represent changed files. Anyone got anything better? Figured there had to be a flag for git status to do this. Even tools like GitX don't easily allow you to...

how to do `git gc' on git remote repository.

As we know, we can run `git gc' periodically to pack objects under .git/objects. for a remote central git repository, for example, a git bare repository. after many pushes, there many files under myproj.git/objects (seems one file for a commit?), how to pack these many files, i mean on remote central bare repository, not on local clon...

Git keeps asking for password

I've searched and searched, for what seems like hours, for a solution to this problem and nothing I've tried works. Let me preface all this by saying that while I've used *nix before, I'm pretty much a noob so I'm sure I missed a step in the setup of Git somewhere. I set up a Ubuntu box on the network at work to host our new Git repo...

Manage source under git and svn simultanously - does it make sense?

This is maybe unusual so let me set the scene: We have an SVN repo containing our project history - an embedded system based on Linux. The SVN repo contains Linux kernel, U-Boot, busybox etc. sources and all our in-house apps, filesystem and such. The Linux kernel we have is old and crusty and I am working on porting to the mainline, w...

Confusion about git checkout

I am confused about a behavior of git checkout. The documentation of git checkout says: --merge When switching branches, if you have local modifications to one or more files that are different between the current branch and the branch to which you are switching, the command refuses to switch branches in order to prese...

Merging changesets in git for a code review

I have around 50 relevant commits on my local git repo, of this list I want to show in a code review only my commits. But they are mixed with other people commits, and some of my commits are corrections to others, so I don't want to go commit by commit because I would step twice in the same code, for the original and for the correction. ...

Git: How do I set up SSH keys to access my remote repository from a second computer?

I have a git repository on Unfuddle, and a Windows machine I'm using with msysgit. I set up an SSH key on that machine using ssh-keygen, which gave me some key files. I copied the contents of the public key file into my personal settings in my Unfuddle account, and that works fine. So what do I need to do to get it working on a second...

git pull fails with "Untracked working tree file 'blah' would be overwritten by merge", but tree is clean

I've checked in some changes to my local repository that I want to push, but when I do a git pull, I get: Paul-Butchers-MacBook-Pro:TouchType-Build paul$ git pull error: Untracked working tree file 'documentation/Android/SwiftKey/buttons.xcf' would be overwritten by merge. Aborting My working tree contains no untracked files: ...

HTAccess Rewrite: 301 Redirect Index but not Subdomain

I'm creating an online community and I'm trying to set up a development server. Currently, I'm using GIT as my repository. I have both mysite.com and mysite.net; the .com being the primary site. My Goal: If a user goes to www.mysite.net they should be 301 redirected to www.mysite.com. If a user goes to dev.mysite.net they should b...

Git: How to ignore fast forward and revert origin [branch] to earlier commit?

Hi, I used git reset --hard dc082bc... to revert to the branch back to a required previous state, due to some bad commits. This has rewound my local branch fine. However, I want to rewind the branch on 'origin' to the same commit so that I can start again. Could anyone tell me how to revert the origin branch (not master) to this com...

How do you deal with file ownership in git?

I'm working on an embedded Linux project. Our build process makes an image that gets flashed to a device. Many of our files require root ownership for the system to work correctly. I ran into a problem when I tried to pull and some of those files were modified - git couldn't write those files, so did reset hard and did sudo pull. Then wh...

git: how to move some commits to new branch

I have been working in straight line: A---B---C---D---E---F (master:HEAD) Now I want to move backward: git checkout C and move few last commits to a new branch: Option 1: D---E---F (new:HEAD) / A---B---C (master) Option 2: F (new:HEAD) / A---B---C (master) How to rebase to Option 1 and h...

How do you alter an object's historical content in a git repository?

I have a local git repository that I eventually plan on publishing as open source. I recently noticed that one of the files has a password in it. Obviously, I need to strike that password from the entire history before I publish the repository. A: Is there a way to access and modify the history for all revisions to that particular fil...

portable git configuration

I have installed the portable git version on my flash drive, but I don't want my repository to be in the same directory as the program. I can get to the directory using: $ git -- git-dir=../Gits --work-tree=..Gits But I don't want to enter that every time. So I found in this article on the gitconfig file. But it only shows how to set ...

Remove all deleted files from "changed but not updated" in Git

When I run git status, I have a bunch of lines of the form deleted: dir/file.js I can remove each of these individually with git checkout -- dir/file.js, but there must be a less painstaking way to do so. (And yes, I know I should've used git rm in the first place...) [Update: As Mark points out below, git checkout -- actually res...

Case typo on path in msysgit

I went out to my github repo and discovered that I had inadvertently added files to msysgit with a typo. Instead of adding files to a directory called "Domain", I added them to "DOmain". I tried git mv, but the path is case-insensitive in Windows and the move fails. What's the best way to resolve an issue like this? ...

Not ignore a file in a sub directory?

I have the following .gitignore file.. *.pyc project/app/dist/* project/bin/* project/etc/* project/var/* !README.txt So far so good, most of my README.txt files are not being ignore, just like i want.. except for project/ect/downloads/README.txt. That file, is being ignored. Why is this? And how can i fix this? If i remember corre...