Various ways to remove local Git changes

I just cloned a git repository and checked out a branch. I worked on it, and then decided to remove all my local changes, as I wanted the original copy. In short, I had to do the following two commands to remove my local changes git checkout . git clean -f My question is, (1) […]

Changing git commit message after push (given that no one pulled from remote)

I have made a git commit and subsequent push. I would like to change the commit message. If I understand correctly, this is not advisable because someone might have pulled from the remote repository before I make such changes. What if I know that no one has pulled? Is there a way to do this?

How do negated patterns work in .gitignore?

I am attempting to use a .gitignore file with negated patterns (lines starting with !), but it’s not working the way I expect. As a minimal example, I have the folllowing directory structure: C:/gittest — .gitignore — aaa/ — bbb/ — file.txt — ccc/ — otherfile.txt and in my gitignore file, I have this: aaa/ […]

Pod install is staying on “Setting up CocoaPods Master repo”

I’m cloning a project from a git repo, but when I execute pod install the first line I see is “Setting up CocoaPods Master repo” and after that I can’t see anything more, the console stops there. I don’t know what is happening. Anyone knows what’s happening here? Why Does CocoaPods stop there?

Git Commit Messages : 50/72 Formatting

Tim Pope argues for a particular git commit message style in his blog post: Here is a quick summary of what he recommends: First line is 50 characters or less Then a blank line Remaining text should be wrapped at 72 characters His blog post gives the rationale for these recommendations (which I will […]

Hash collision in git

What would actually happen if I had a hash collision while using git? E.g. I manage to commit two files with the same sha1 checksum, would git notice it or corrupt one of the files? Could git be improved to live with that, or would I have to change to a new hash algorithm? (Please […]

“fetch –all” in a git bare repository doesn't synchronize local branches to the remote ones

I’m trying to synchronize periodically a git bare repository, my local branches are created using the “–track” option. here is my config (without unnecessary things): [core] bare = true [remote “origin”] url = fetch = +refs/heads/*:refs/remotes/origin/* [branch “master”] remote = origin merge = refs/heads/master [branch “website”] remote = origin merge = refs/heads/website I must […]

git mv and only change case of directory

While I found similar question I didn’t find an answer to my problem When I try to rename the directory from FOO to foo via git mv FOO foo I get fatal: renaming ‘FOO’ failed: Invalid argument OK. So I try git mv FOO foo2 && git mv foo2 foo But when I try to […]

How do I rename a repository on GitHub?

I wanted to rename one of my repositories on GitHub, but I got scared when a big red warning said: We will not set up any redirects from the old location You will need to update your local repositories to point to the new location Renaming may take a few minutes to complete Does anyone […]

LF will be replaced by CRLF in git – What is that and is it important?

Possible Duplicate: git replacing LF with CRLF When I create a new rails application I’m seeing a warning in git about LF replacement. I do git init git add . and then boom! I see this pop up for almost all files. I usually just keep going and build my application and it disappears after […]

Git Baby is a git and github fan, let's start git clone.