commit

How to remove the first commit in git?

冷暖自知 提交于 2019-12-17 17:24:40
问题 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? 回答1: 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

Git error on commit after merge - fatal: cannot do a partial commit during a merge

天大地大妈咪最大 提交于 2019-12-17 17:20:04
问题 I ran a git pull that ended in a conflict. I resolved the conflict and everything is fine now (I used mergetool also). When I commit the resolved file with git commit file.php -m "message" I get the error: fatal: cannot do a partial commit during a merge. I had the same issue before and using -a in commit worked perfectly. I think it's not the perfect way because I don't want to commit all changes. I want to commit files separately with separate comments. How can I do that? Why doesn't git

What should I do when git revert aborts with an error message?

一个人想着一个人 提交于 2019-12-17 16:24:32
问题 OK, so I'm getting an error sometimes when I try to revert a commit (with Git). All that I do is git revert <commit hash> and it gives me this message: error: could not revert <commit hash> <commit message> hint: after resolving the conflicts, mark the corrected paths hint: with 'git add <paths>' or 'git rm <paths>' Does this mean that I should use git mergetool and resolve any conflicts? Once I do this can I add/rm and then commit, and the revert is complete? 回答1: Yes you will have to

git commit to all branches

社会主义新天地 提交于 2019-12-17 16:19:24
问题 If I fixed a bug in a file in branch branch_a , which should be applied to all branches. Is there a way to apply the change to all branches without having to checkout the branches individually. git commit -m 'commit msg' # on branch a git checkout branch_b git cherry-pick branch_a git checkout branch_c git cherry-pick branch_a What i would like to have is a git commit --to-all-branches which tries to propagate the changes to all branches if possible. Edit To clarify a bit my situation, I

git commit to all branches

给你一囗甜甜゛ 提交于 2019-12-17 16:18:51
问题 If I fixed a bug in a file in branch branch_a , which should be applied to all branches. Is there a way to apply the change to all branches without having to checkout the branches individually. git commit -m 'commit msg' # on branch a git checkout branch_b git cherry-pick branch_a git checkout branch_c git cherry-pick branch_a What i would like to have is a git commit --to-all-branches which tries to propagate the changes to all branches if possible. Edit To clarify a bit my situation, I

Getting “CHECKOUT can only be performed on a version resource” when trying to commit using Eclipse subversive plugin

淺唱寂寞╮ 提交于 2019-12-17 15:35:18
问题 I'm using Eclipse Juno on Mac 10.7.5, SVN 1.7 and the Eclipse Subversive plugin. Occassioanlly, when I try and commit changes from my project (by right clicking on the project from the package explorer, selecting "Team" -> "Commit"), I get the error: Some of selected resources were not committed. Some of selected resources were not committed. svn: E200007: Commit failed (details follow): svn: E200007: Commit failed (details follow): svn: E200007: CHECKOUT can only be performed on a version

SVN commit with old date/time

只谈情不闲聊 提交于 2019-12-17 12:38:17
问题 Is there some way how to commit into the SVN repository with old time / date or how to edit the time / date post commit? I have some archived sources which are very old, way before I have started using SVN, and I would now like to put them into the SVN and if possible to preserve their original date, so that SVN history matches the real date where files were edited. Manipulating SVN server time is an obvious option, but it cannot be used here, as the SVN server is out of my control. 回答1: The

Add commits before root commit in Git? [duplicate]

Deadly 提交于 2019-12-17 10:47:14
问题 This question already has answers here : Insert a commit before the root commit in Git? (15 answers) Closed 6 years ago . New Question Two questions: I'm trying to put a commit before ALL commits. The bottommost commit has 660fb2a76211f36ec9a67d0454a90eab469e9fd0 as SHA. When I type git rebase -i 660fb2a76211f36ec9a67d0454a90eab469e9fd0 every commit but the last one gets displayed in the list. I really need this commit to appear so I can put the very first commit as very last! When I put the

Add commits before root commit in Git? [duplicate]

谁说胖子不能爱 提交于 2019-12-17 10:47:02
问题 This question already has answers here : Insert a commit before the root commit in Git? (15 answers) Closed 6 years ago . New Question Two questions: I'm trying to put a commit before ALL commits. The bottommost commit has 660fb2a76211f36ec9a67d0454a90eab469e9fd0 as SHA. When I type git rebase -i 660fb2a76211f36ec9a67d0454a90eab469e9fd0 every commit but the last one gets displayed in the list. I really need this commit to appear so I can put the very first commit as very last! When I put the

Git commit to common submodule (master branch)

被刻印的时光 ゝ 提交于 2019-12-17 10:11:34
问题 I've two or more projects (let's call them ProjectFoo and ProjectBar ) having some common code that I put in a submodule . My understanding is that if I commit changes to a submodule from within ProjectFoo it'll be in a detached head that only all ProjectFoo clones can see: (master) $ cd ProjectFooBarCommoneSubmodule/ (master) $ git commit -am "Common code fix." (56f21fb0...) $ git push Everything up-to-date That's probably because the master branch hasn't changed. I could probably do