git-commit

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

折月煮酒 提交于 2019-11-28 03:03:12
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 : Directory not empty This was after I already deleted the .git-rewrite directory on Windows. How can I remove that file? It's a 29Mb file sitting on my repo, so I quite need to remove the file. I tried to delete the

Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch

强颜欢笑 提交于 2019-11-28 02:30:33
I am using Git. I did a pull from a remote repo and got an error message: "please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch." I try to type a message and press Enter but nothing happens. How do I tell Git/terminal I am done typing in my message? I am using terminal on OS X. It's not a Git error message, it's the editor as git uses your default editor. To solve this: press "i" write your merge message press "esc" write ":wq" then press enter xiaohu Wang Actually it's not an error! It means you should enter some

How do I reword the very first git commit message?

喜你入骨 提交于 2019-11-27 19:57:00
问题 I have a working tree containing 3 commmits: ➜ ~myproject git:(master) git log commit a99cce8240495de29254b5df8745e41815db5a75 Author: My Name <my@mail.com> Date: Thu Aug 16 00:59:05 2012 +0200 .gitignore edits commit 5bccda674c7ca51e849741290530a0d48efd69e8 Author: My Name <my@mail.com> Date: Mon Aug 13 01:36:39 2012 +0200 Create .gitignore file commit 6707a66191c84ec6fbf148f8f1c3e8ac83453ae3 Author: My Name <my@mail.com> Date: Mon Aug 13 01:13:05 2012 +0200 Initial commit (with a misleading

Troubleshooting misplaced .git directory (nothing to commit)

别等时光非礼了梦想. 提交于 2019-11-27 19:35:56
I started getting this message. No matter what I edit and try to commit, it says there is nothing to commit. Looks like git does not see my working directory and looking somewhere else. If I run git status it outputs the same: nothing to commit (working directory clean) If I create new branch and edit something, then same thing happens. This started happening when I needed to fix merge clashes. When I wanted to merge my one branch with master branch, I had to manually fix it and I needed my files to look exactly as in that branch overwriting master branch those same files. So I added those

Telling if a Git commit is a Merge/Revert commit

核能气质少年 提交于 2019-11-27 17:08:01
问题 I am writing a script that requires checking whether a particular commit is a Merge/Revert commit or not, and I am wondering if there is a git trick for that. What I came up with so far (and I definitely don't want to depend on the commit message here) is to check HASH^2 and see if I don't get an error, is there a better way? 回答1: Figuring out if something is a merge is easy. That's all commits with more than one parent. To check for that, you can do, for example $ git cat-file -p $commit_id

How to remove the first commit in git?

那年仲夏 提交于 2019-11-27 16:49:09
I am curious about how to remove the first commit in git. What is the revision before committing any thing? Does this revision have a name or tag? For me, the most secure way is to use the update-ref command: git update-ref -d HEAD It will delete the named reference HEAD , so it will reset (softly, you will not lose your work) all your commits of your current branch . If what you want is to merge the first commit with the second one, you can use the rebase command: git rebase -i --root A last way could be to create an orphan branch, a branch with the same content but without any commit history

How to amend a commit without changing commit message (reusing the previous one)?

China☆狼群 提交于 2019-11-27 16:35:41
Is there a way to amend a commit without vi (or your $EDITOR ) popping up with the option to modify your commit message, but simply reusing the previous message? Shaggie Since git 1.7.9 version you can also use git commit --amend --no-edit to get your result. Note that this will not include metadata from the other commit such as the timestamp which may or may not be important to you. git commit -C HEAD --amend will do what you want. The -C option takes the metadata from another commit. Another (silly) possibility is to git commit --amend <<< :wq if you've got vi(m) as $EDITOR . To extend on

Xcode 9 commit: Couldn't communicate with helper application

混江龙づ霸主 提交于 2019-11-27 13:53:51
I've recently updated to OSX Sierra (from El Capitan) and to Xcode 9. I removed all compatibility issues (like autolayout issues) and would like to commit to my local gitrep now. the following error appears: I thought it might be the same bug appeared in XCode 7 mentioned here: Xcode and Git Source Control : “The working copy XXXXX failed to commit files” But it wasn't. I tried the solution mentioned above. Username and EMail are properly set. I did save everything, tried restarting the machine and a few other minor things. Nothing worked - i can't commit. Any help appreciated. EDIT I got it

Using IntelliJ to amend git commit message

余生长醉 提交于 2019-11-27 11:24:12
Can one amend a git commit message using IntelliJ , or should one resort to command line? How can this be done please? View => Tool Windows => Version Control. ( Windows (Alt + 9) / OS X (Cmd + 9) ) IntelliJ 2017.1 and higher => Go to Log and right click + reword or press F2. While you are on the same branch, ( your checked out branch is the same ) Amend is supported: invoke "Commit Changes" and select the checkbox "Amend commit" in the Commit Dialog. Then press "Commit" button, and the commit will be amended to the previous one. However, the support is limited: you can't see the details of

Why am I getting “Commit failed with error: pathspec … did not match any file(s)”?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 11:02:53
问题 I am having some issues with Git. I have a repository where I can commit any file to without problem. However, there is a single file 'Funder.php' which, when I try committing, tells me there is an error as: Commit failed with error: pathspec 'application/libraries/Funder.php' did not match any file(s) known to git. I am quite new to this, so was wondering if anybody could please help? 回答1: This is the error you get when you attempt to run git commit <file> but <file> hasn't been staged yet;