Purging file from Git repo failed, unable to create new backup

I tried to remove a file from my remote repo by running: git filter-branch –index-filter ‘git rm –cached –ignore-unmatch Rakefile’ HEAD But Git complains that Cannot create new backup. A previous backup already exists in refs/original/ Force overwriting the backup with -f rm: cannot remove /.git-rewrite/backup-refs : Permission denied rm: cannot remove directory /.git-rewrite : […]

Git On Custom SSH Port

My VPS provider recommends that I leave my SSH port to the custom port number they assign it by default (not 22). The thing is the while I know I can give the port number when create a remote config, it seems like I can’t do the same when doing a git clone. I am […]

Git clone particular version of remote repository

I cloned a remote git repository about a month ago. The remote repository has undergone many changes and has now become unstable. Now I need another copy of the repository, version identical to the one I cloned a month ago. How do I do this?

Adding Git notes to a blob

I am trying to realize a use-case using git. Use Case : It should be possible to add metadata (like Attributes) to git artifacts. We plan to have a git repo for each component, so applying a note for each commit object could realize this requirement. Now, it is also required that we have metadata […]

Should “node_modules” folder be included in the git repository

I’m wondering if we should be tracking node_modules in our repo or doing an npm install when checking out the code?

How to handle/fix git add/add conflicts?

I’m not sure when this error occurs, I haven’t found any descriptions in google. So my colleagues commited some new files and changed files on branch1. I then got these changes and merged them into my branch(branch2) but NOT using git merge but manually using beyond compare (I know it’s a bad practice merging manually). […]

Why Git doesn't ignore my specified file?

I add the following line to .gitignore but when I type “git status” it show the file as unstaged file.what’s the problem? all other patterns work good. .gitignore file content: sites/default/settings.php Thanks for replies.but still doesn’t work.my friend told maybe file(to be ignored) is added manually.if it’s true how can I solve it?It seems problem […]

override git from Xcode with homebrew version

I’ve installed XCode and therefore git is there as well. Since i want to have a newer version of git I installed using homebrew. But the homebrew version of git is never called since my PATH looks like this /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin which means the /usr/bin/git is allways called before /usr/local/bin/git. Is there a way to change […]

Disable Git Rename Detection

I have a file, foo.txt Create and checkout branch ‘branch_A’ git mv foo.txt bar.txt followed by git add -A then git commit -m “renamed foo.txt” Checkout master, git checkout master remove foo.txt and commit. Now merge branch_A, git merge branch_A And with this, I get an merge conflict (rename/delete). CONFLICT (rename/delete): Rename foo.txt->bar.txt in branch_A […]

In git, how do I check out a remote repository's remote branches?

I have a local repository cloned from a bare remote repository. The following command lists al the remote repository’s branches. $ git ls-remote <remote> 74bd3eb190edb39db04f6c0c4dbbb9e1e96bc6db refs/remotes/test 85de54d6ae813c624b9623983e6b0a4948dae0fe refs/remotes/trunk I want to checkout and track that remote’s remote branch trunk. How do I do that? Note that this is different from checking out a remote repository’s […]

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