commit

Delete a specific commit knowing commit id

非 Y 不嫁゛ 提交于 2020-02-22 08:08:38
问题 Lets say i have a repo (git version 1.7.1) that contains following commits A -> B -> C -> D ->E and my HEAD is on E . Now i want to delete C while keeping everything same like A -> B -> D -> E . Can you help me how to do it? 回答1: You can do this with git rebase -i B . Note however, that D and E will be rewritten (get different commit SHAs), so the result will be A -> B -> D' -> E' . The content of E' should be equivalent to E (minus the changes that had been made in C which you are now

Delete a specific commit knowing commit id

落花浮王杯 提交于 2020-02-22 08:01:25
问题 Lets say i have a repo (git version 1.7.1) that contains following commits A -> B -> C -> D ->E and my HEAD is on E . Now i want to delete C while keeping everything same like A -> B -> D -> E . Can you help me how to do it? 回答1: You can do this with git rebase -i B . Note however, that D and E will be rewritten (get different commit SHAs), so the result will be A -> B -> D' -> E' . The content of E' should be equivalent to E (minus the changes that had been made in C which you are now

Is there an upper limit to the number of commits a git repository can handle?

主宰稳场 提交于 2020-02-01 10:34:08
问题 I'm wondering if there's an upper limit to the number of commits that a git repository can handle. In a solo project I'm working on right now, I've been coding locally, committing/pushing changes in git, then pulling the changes on my development server. I treat this as an easier alternative to working locally and uploading changes via FTP... Fortunately/Unfortunately it's such an easy workflow that I sometimes go through many edit/commit/push/pull/browser-refresh cycles while coding. I'm

Github, forked repositories ahead of master: active users

强颜欢笑 提交于 2020-01-24 03:04:45
问题 There is a certain repository that has been forked by many tens of users. However most of them are inactive. The ones that are still active will probably have n commits ahead of master. However when I click on fork I can see all the users that forked but I cannot select the ones that are active. Is there a way to see who's active or who has commits ahead of master? 回答1: Basically, you can click on the insights tab along with the issue and pull request . And you will see a sidebar on the left.

Github, forked repositories ahead of master: active users

跟風遠走 提交于 2020-01-24 03:03:07
问题 There is a certain repository that has been forked by many tens of users. However most of them are inactive. The ones that are still active will probably have n commits ahead of master. However when I click on fork I can see all the users that forked but I cannot select the ones that are active. Is there a way to see who's active or who has commits ahead of master? 回答1: Basically, you can click on the insights tab along with the issue and pull request . And you will see a sidebar on the left.

GIT: efficient way to prevent commiting non-functional changes?

ε祈祈猫儿з 提交于 2020-01-23 16:56:30
问题 I don't want any non-functional changes like spacing, new lines, tabs in my commits. I used to use SVN which had a UI showing 2 screens (old file on left, file I'm about to commit on right) that let me quickly go through all my changes (down arrow) and change which way the arrow pointed (right meant commit it, left meant revert it back to how it was). What are some similar, or even better ways to solve this problem in git? 回答1: A setting like this one would do the trick: git config apply

How to move commits to another branch?

旧巷老猫 提交于 2020-01-22 10:32:29
问题 I'd like to move my last few commits from master into a branch of their own. The tree on my PC looks like that: W (some branch) / X1--X2--X3--X4--Y--Z1--Z2 (master) I'd like it to look like: W (some branch) / X1--X2--X3--X4 (master) \ Y--Z1--Z2 (my new branch) However, the tree at GitHub looks like: W (some branch) / X1--X2--X3--X4--Y (master) That's what I saw as a solution for moving the last commits to another branch: git checkout master git branch my_new_branch git reset <commit_id> My

How to move commits to another branch?

╄→гoц情女王★ 提交于 2020-01-22 10:32:07
问题 I'd like to move my last few commits from master into a branch of their own. The tree on my PC looks like that: W (some branch) / X1--X2--X3--X4--Y--Z1--Z2 (master) I'd like it to look like: W (some branch) / X1--X2--X3--X4 (master) \ Y--Z1--Z2 (my new branch) However, the tree at GitHub looks like: W (some branch) / X1--X2--X3--X4--Y (master) That's what I saw as a solution for moving the last commits to another branch: git checkout master git branch my_new_branch git reset <commit_id> My

Exclude some files on svn command line commit (not svn:ignore)

拈花ヽ惹草 提交于 2020-01-21 10:45:10
问题 I'm developing with many people. I check out remote repository, get 3 file. After edit, run: svn status It shows: M file_1 M file_2 M file_3 Now, I want to commit only two file: file_1, file_2, but not file_3. How to do it? I dont' want to use svn revert file_3 before commit. Explain: I edit file_1, file_2 for shared project, file_3 for running on only my local machine. 回答1: How about: $ svn commit file_1 file_2 回答2: Expanding upon zoul's answer.. to develop your list of files use: svn stat |

git log <filename> doesn't show commit, but git log shows commit that edited the file

心已入冬 提交于 2020-01-15 12:33:29
问题 I discovered this odd issue while looking for a lost change. I typed in: git log httpd.conf I am getting a bunch of commit hashes as expected, but not the one I did. When I type in: git log I see the commit I made. When I run: git show <hash> I see my edits to httpd.conf Can anyone explain what may have happened? If there is more information needed to discover the root please let me know. 回答1: From git docs (http://git-scm.com/docs/git-log): Default mode - simplifies the history to the