git-rebase

Why are my .csproj files getting messed up after a git rebase?

橙三吉。 提交于 2019-12-03 05:59:16
问题 In a .NET C# project which uses GIT for source control, I keep getting malformed csproj files after rebasing to get the most recently commited code. This is my process: commit my code build and run tests rebase to "get latest" curse the heavens, as the csproj file is screwed up... AGAIN Here's the output on the rebase: D:\GitHub\AwesomeProject>git rebase master First, rewinding head to replay your work on top of it... Applying: added getstatus call Using index info to reconstruct a base tree.

Git branch has diverged after rebase, so why rebase?

心已入冬 提交于 2019-12-03 05:54:49
问题 Recently I came across the notification that my branch has diverged. That was when I made a feature branch, pushed it to remote, and did a rebase with master a few days later when I started working on it again. git checkout -b feature-branch git push origin feature-branch:feature-branch ...and when in master... git pull origin master git checkout feature-branch git rebase master But when I want to push my branch again, it says: On branch feature-branch Your branch and 'origin/feature-branch'

how to rebase and keep commits in chronological order?

两盒软妹~` 提交于 2019-12-03 05:52:43
I would like to rebase a branch on the master branch but in such a way that all commits show up in chronological order in the git log. Is this possible without git rebase --interactive and rearranging the commits manually? Background: I am using git for keeping track of the puppet configuration of a server farm. The master branch is always in a known good state, so that all existing servers can retrieve their configuration from the puppet master server. Each new server gets its own branch, so whenever I work on the configuration of a new server, such as changing a domain name, configuring an

On conflict, GitHub for Windows puts me in “rebasing” state, how to go from there?

前提是你 提交于 2019-12-03 05:51:32
I recently started using GitHub for Windows . I just got a conflict. On command line I would know how to handle this, but GitHub for Windows choosed to put me in a state I am not familiar with: C:\Users\w\Documents\GitHub\CmisSync [(6026d18...)|REBASE +0 ~1 -0 !1 | +0 ~0 -0 !1]> git status # Not currently on any branch. # You are currently rebasing. # (fix conflicts and then run "git rebase --continue") # (use "git rebase --skip" to skip this patch) # (use "git rebase --abort" to check out the original branch) # # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) ... I

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

依然范特西╮ 提交于 2019-12-03 05:49:30
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 dance without all of the checkouts, and preferably without (manually) creating the temporary branch?

Flatten old history in Git

偶尔善良 提交于 2019-12-03 05:48:45
I have a git project that has run for a while and now I want to throw away the old history, say from start to two years back from now. With throw away I mean replace the many commits within this time with one single commit doing the same. I checked git rebase -i but this does not remove the other (full) history containing all commits from git. Here a graphical representation (d being the changesets): (base) -> d1 -> d2 -> d3 -> (HEAD) What I want is: (base) -> d1,d2 -> d3 -> (HEAD) How could this be done? Thanks. EDIT I got it working with git rebase -i cd1e8c9 with cd1e8c9 being the start

How to make a git rebase and keep the commit timestamp?

房东的猫 提交于 2019-12-03 04:03:39
I want to make a rebase to remove a certain commit from my history. I know how to do that. However if I do it, the commit timestamp is set to the moment I completed the rebase. I want the commits to keep the timestamp. I saw the last answer here: https://stackoverflow.com/a/19522951/3995351 , however it didn't work. The last important command just showed a new line with > So I am opening a new question. The setup Let's say this is the history around the commit you want to remove ... o - o - o - o ... ... o ^ ^ ^ ^ | | +- next | | +- bad +-- master (HEAD) start where: bad is the commit you want

How to update topic branch with upstream changes on master?

不羁岁月 提交于 2019-12-03 03:24:34
I start some work on a topic branch •-•-• < topic / •-• < master I push the topic branch $ git push origin topic Someone else pushes changes to master •-•-• < origin/topic / •-•-•—• < origin/master How do I update my local master and rebase my topic? History should look like this •-•-• < topic / •-•-•—• < master What I am trying ; update master $ git checkout master $ git fetch origin $ git merge --ff-only origin/master ; rebase topic $ git checkout topic $ git rebase master The problem All of my commits on topic are seen as uncommitted. So when I try git push origin topic , I get ! [rejected]

git: How to rebase all commits by one certain author into a separate branch?

三世轮回 提交于 2019-12-03 03:00:22
I'm using some code for which no SCM is used + and receive occasional updates in the form of all project files although only some of them have been changed only a bit. Up till now I just put my own changes in a git repo and solved these "updates" with a manual git add -p session which is getting more and more annoying with the amount of my own changes (those that are not determined to be published yet) increasing, and since luckily I did git commit --author "the others" for aforementioned "patches", I'd like to know: How can all commits made by one author be separated into a new branch? (I don

Git: How to properly merge two functional and quite different branches?

被刻印的时光 ゝ 提交于 2019-12-03 02:57:30
Imagine a situation where you have two branches of the same project, with one part of the first branch dramatically refactored over the other one. But for a while you need to keep both branches functional, so you are doing bug fixes and crucial feature additions to both of them, sometimes in a not symmetrical way. And at some point there comes a moment when you have to merge refactored branch onto the original one. What is the best technique to use in a situation like this? Is it still possible to keep the history clean? But more importantly what should have been my initial strategy in such