git-rebase

Detailed reason why remote git rebase is so evil

怎甘沉沦 提交于 2019-11-28 05:24:06
问题 So I come from a centralized VCS background and am trying to nail down our workflow in Git (new company, young code base). One question I can't find a simple yet detailed answer to is what exactly does rebase on a remote branch do. I understand it rewrites the history, and in general should be limited to local branches only. The workflow I'm currently trying to vet out involves a remote collaboration branch, each dev "owning" one for the purpose of sharing code. (Having 2 developers and max 3

How to know if there is a git rebase in progress?

谁说我不能喝 提交于 2019-11-28 04:49:02
When I start a git rebase -i , I can issue commands like git rebase --continue , or git rebase --abort . Those commands only work if a rebase is in progress. How can I know if there is a rebase in progress? (I would greatly appreciate some details on how rebase works internally; what does git do to a repo that gives it the "rebase in progress" status,?) VonC For one thing, there is a ORIG_HEAD in place during a rebase (but that is not limited to the rebase command) But you can also look at the 2010 Git 1.7.0 git-rebase.sh script itself (which is as "internal" as you can get ;) ). Lines like

“git rebase origin” vs.“git rebase origin/master”

倾然丶 夕夏残阳落幕 提交于 2019-11-28 04:38:09
I don't get the difference between git rebase origin and git rebase origin/master . In my case I cloned a git repository twice. In the first clone I have to use git rebase origin and in the other clone I must use git rebase origin/master . An example: http://paste.dennis-boldt.de/2011/05/11/git-rebase git rebase origin means "rebase from the tracking branch of origin ", while git rebase origin/master means "rebase from the branch master of origin " You must have a tracking branch in ~/Desktop/test , which means that git rebase origin knows which branch of origin to rebase with. If no tracking

Git Squash by author - All author commits into a single commit

≯℡__Kan透↙ 提交于 2019-11-28 03:50:06
问题 I am trying squash many commits into a single one, the problem is that I need do that by author (name or email). The case: Lets say I have a branch called feature-a, in this branch I have many commits for many authors. How can I squash all commits by author (email for example) into a single commit. I want do that to be able to merge all author commits into master. Any help here? Thanks in advance 回答1: Be careful rewriting history The end result you want might be possible if you create

How do I reduce the size of a bloated Git repo by non-interactively squashing all commits except for the most recent ones?

岁酱吖の 提交于 2019-11-28 03:43:24
问题 My Git repo has hundreds of gigabytes of data, say, database backups, so I'm trying to remove old, outdated backups, because they're making everything larger and slower. So I naturally need something that's fast; the faster, the better. How do I squash (or just plain remove) all commits except for the most recent ones, and do so without having to manually squash each one in an interactive rebase? Specifically, I don't want to have to use git rebase -i --root For example, I have these commits:

extract multiple directories using git-filter-branch

限于喜欢 提交于 2019-11-28 03:21:10
I have a big repository which currently contains multiple projects in top level subfolders, say /a , /b , /c , and /d . Now I want to split up that repository into two different repositories: one containing /a and /b and the other containing /c and /d . I am aware of git filter-branch --subdirectory-filter , which is perfect for extracting a single directory, but it seems not to be able to extract multiple directories at once. I am also aware of git filter-branch --prune-empty --tree-filter , which would allow me to delete everything, but the two wanted directories. This feels not completely

I need to pop up and trash away a “middle” commit in my master branch. How can I do it?

只愿长相守 提交于 2019-11-28 03:17:49
For example, in the following master branch, I need to trash just the commit af5c7bf16e6f04321f966b4231371b21475bc4da, which is the second due to previous rebase: commit 60b413512e616997c8b929012cf9ca56bf5c9113 Author: Luca G. Soave <luca.soave@gmail.com> Date: Tue Apr 12 23:50:15 2011 +0200 add generic config/initializers/omniauth.example.rb commit af5c7bf16e6f04321f966b4231371b21475bc4da Author: Luca G. Soave <luca.soave@gmail.com> Date: Fri Apr 22 00:15:50 2011 +0200 show github user info if logged commit e6523efada4d75084e81971c4dc2aec621d45530 Author: Luca G. Soave <luca.soave@gmail.com>

What does “Auto packing the repository for optimum performance” mean?

烂漫一生 提交于 2019-11-28 02:47:16
I'm having a problem with my git repo. For the last couple of days whenever I do a push to the server I get this message: "Auto packing the repository for optimum performance", and it does not seem to go away and return the shell. I also tried checking out to a new branch and then doing a rebase on my previous branch and then did git gc to remove the unused history objects and then did a push but still this message appears. Please let me know what's going on with my repo. Short version: it means what it says, and if you just let it finish, all will be well. During most operations which can

Why does git-rebase give me merge conflicts when all I'm doing is squashing commits?

给你一囗甜甜゛ 提交于 2019-11-28 02:42:09
We have a Git repository with over 400 commits, the first couple dozen of which were a lot of trial-and-error. We want to clean up these commits by squashing many down into a single commit. Naturally, git-rebase seems the way to go. My problem is that it ends up with merge conflicts, and these conflicts are not easy to resolve. I don't understand why there should be any conflicts at all, since I'm just squashing commits (not deleting or rearranging). Very likely, this demonstrates that I'm not completely understanding how git-rebase does its squashes. Here's a modified version of the scripts I

Why is “rebase --onto ABC” different than “rebase ABC”?

余生长醉 提交于 2019-11-28 01:58:02
问题 Using git 2.11, git rebase documentation says: The current branch is reset to <upstream>, or <newbase> if the --onto option was supplied. This has the exact same effect as git reset --hard (or ). ORIG_HEAD is set to point at the tip of the branch before the reset. I understand it as if upstream and newbase points to the same "base reference", then this means the two rebase syntaxes below are equivalent: git rebase ABC git rebase --onto ABC Here is the demo I setup. Let's assume the current