rebase

How to run tests for all commits during a rebase

余生颓废 提交于 2019-12-04 02:14:33
I have a feature branch with plenty of commits. A---B---C master \ \-B'---C'---D'...---Z' feature I am working on feature but another developer has created commits B and C . Now I want to rebase feature on commit C , but I and/or automerge introduced errors during the rebase. My project has very good test coverage and I can run the tests from console using ant rebuild test , and now I want git to tell me which commit is the first commit that breaks my test so I can fix that commit. How can I do that? While you are on branch feature execute: git rebase --interactive --exec "ant rebuild test" C

can i rebase old commits?

吃可爱长大的小学妹 提交于 2019-12-04 00:10:09
I have just started using git. Rebase is great stuff. I should have used it in a specific earlier case. is there a perfectly acceptable way to rebase old commits for the sake of clear commits? Brian L You should positively only do this for commits that have not been pushed upstream. That said, I find it easiest to use git rebase -i <commit> where <commit> is the id of a commit that is at least as old as the newest one you do not want to mess with. When your editor pops up, it will contain instructions about how to squash and/or delete commits. In general, if you've shared a commit with someone

What git commit practice is better?

China☆狼群 提交于 2019-12-03 17:50:02
问题 I truly believe that to have one commit on one issue is a good practice. I'm sure I read it somewhere in an article like “Best practices”. As such, my workflow has been the following: For a new issue, I create a new local branch with git checkout -b new-issue . Commit all changes into it. Sometimes this involves lots of commits. When done, I squash the commits and rebase them into current thematic branch. If something goes wrong, I can git revert the commit, find the bug, fix it, and commit

GIT Rebase a Branch that is collaborated on?

前提是你 提交于 2019-12-03 17:06:50
问题 After reading this article, it makes sense to rebase to gather changes from the main branch on to my feature branch: Git workflow and rebase vs merge questions clone the remote repo git checkout -b my_new_feature ..work and commit some stuff git rebase master ..work and commit some stuff git rebase master ..finish the feature git checkout master git merge my_new_feature This works great if the feature branch is local to my machine and I can rewrite history as I please. But what if I

Removing large file from git history?

寵の児 提交于 2019-12-03 16:38:59
We have a remote git repository where there are no size restrictions for files and we had pushed a 300MB into it. We then realized it and then removed the file from the repository. Meanwhile the same repository was added to github and when we try to push the changes to github, we get the large file size error. remote: error: File dir/filename is 312.27 MB; this exceeds GitHub's file size limit of 100 MB To fix this, I tried using the interactive git rebase solution suggested at How to remove/delete a large file from commit history in Git repository? , but at the end of the rebase operation I

Git rebase branch with merged children

╄→尐↘猪︶ㄣ 提交于 2019-12-03 16:32:33
问题 Today I faced with one problem. My teammate created branch from master. He developed one feature in this branch and after that developed two subfeatures in subfeature's branches. At last he did two refactoring commit of the entire thing. So... C--D E--F | subfeatures / \ / \ B------M1------M2--G--H | feature / A-------------------K | master Usually we rebase feature branches before no-fast-forward merge it into master. But of course this rebase fails. Rebased feature branch became looking

Recovering from a failed rebase

好久不见. 提交于 2019-12-03 16:17:03
问题 I'm using git svn to get some git goodness with the company-mandated svn server. I just had a rebase go horribly awry, and I"m trying to figure out the best way to recover. Here's what happened: To start with, I had this ---1 (master) \--B--C--D--E (feature/fix-widgets) So then I did git checkout master and then git svn rebase on master to pull down those commits. I did not anticipate any conflicts between my feature branch and the master, because the changes were in a totally different

`git svn rebase` vs `git rebase trunk`

匆匆过客 提交于 2019-12-03 15:46:38
问题 I'm working on a project that uses subversion for their repository. Because I need to make some changes that can't be sent to the svn server yet, I started using git svn so that I could do local checkins. My setup looks like this: Branches: trunk (tracking svn trunk), master (pretty close to what's in svn), and topic. *------------------ trunk \ *-----------*--------- master \ *-------- topic Workflow: [on branch master] $ git svn fetch $ git svn rebase $ git checkout -b topic $ git rebase

Pull, rebase, push, in one command (or just a few)

最后都变了- 提交于 2019-12-03 15:15:17
问题 When using Git, I often find myself doing the following when working in master : # work work work... $ git checkout -b temp $ git commit -a -m 'more work done' $ git checkout master $ git pull origin master # turns out master was updated since my previous pull $ git checkout temp # I don't want a merge commit for a simple bugfix $ git rebase master $ git checkout master $ git merge temp $ git push origin master $ git branch -d temp ... and I get tired of doing this. Is there a way to do this

How to fix commit order in GitHub pull requests, broken by git rebase?

纵饮孤独 提交于 2019-12-03 14:53:18
问题 When I write code I break it into small logical changes that are easy and quick to review. To do so, I use git rebase -i (interactive) to squash, drop and change order of commits. I've noticed this sometimes leads to a different order of commits on a GitHub pull request (though the order is retained on the remote branch). For example, commit 1 commit 2 commit 3 might show up in the PR as: commit 3 commit 1 commit 2 I've searched the internet and only managed to find this GitHub help page: Why