Questions tagged [rebase]

1

votes
2

answer
38

Views

git merge/rebase/cherrypick skipping commits on master

I have the following situation: _____________G ..myBranch / / S---B---C1---C2---C3---C..---C230 .. master S=working version B=bad version of task G=good version of task C=commit after B and I would like to commit and merge the master into myBranch without using B and then merge myBranch into master...
Applecow
1

votes
1

answer
35

Views

Git - rebase to one commit without resolving conflicts

Suppose I've been working on a branch called my-branch, occasionally merging commits from master to stay up-to-date. On some merges I had to resolve conflicts, which was time consuming. Now I'm done with my-branch and I want to rebase it to one commit on top of master. During the rebase I'll have to...
Rafał G.
1

votes
1

answer
30

Views

Is there a way to non-interactively rebase and squash everything in my feature branch?

Sometimes I have a bunch of small commits in a feature branch, and I'd like to just squash them all together, but not merge into the parent branch yet. I know I can (in this example parent branch is master): git rebase -i master and then tag all of the commits after the first as 'squash'. Is there a...
1

votes
2

answer
61

Views

How to rebase cloned branch with master

I am working with another developer on the same branch. He first created branch abc and then I cloned it: git clone -b abc https://github.cerner.com/path/to/some/repo This just created a branch abc and no master branch. We pushed our changes and now I want to rebase it with master. Since there is no...
jose1221
1

votes
0

answer
65

Views

Trying to git rebase my last 7 commits

I'm working on a local git repo on a branch named '106' I want to clean up my commit log so I run the command: git rebase -i HEAD~7 106 but instead of giving me the last 7 commits it gives me around the last 30. I figure that's fine, I will just leave all those old commits as pick and they wont be...
LWin
1

votes
0

answer
41

Views

Vim encryption and rebasing

I was rebasing some of my old git commits to squash them into a new commit, but I'm new to Vim and accidentally set an encryption key while in the middle of the rebase. Since Vim encryption is normally used for files, what happens to the encryption key I set in the middle of the rebase? Did I encryp...
user8556441
1

votes
1

answer
33

Views

Issue with deliver vs rebase in clearcase ucm

I am in a confusion here on UCM rebase vs deliver. So, I have a parent stream A and two child streams B and C taken from different baselines of parent stream.Now, I have delivered from stream B to Stream A and created a new baseline. Now, I tried to rebase stream C and I got very few elements to mer...
user2636464
1

votes
0

answer
27

Views

Git rebase is missing non-conflict files when applying a patch fails

Ran into a peculiar problem that was reproducible on one MacBook Pro (we'' call this the bad one), one Windows using msysgit, but not on another MacBook Pro (we'll call this the good one). Rebased a feature branch off of master that was only 1 commit behind master. The feature branch had 1 new commi...
PGT
1

votes
0

answer
71

Views

Git: Rebase multiple sequential branches automatically

So let's say I have this branch structure (hashes are made up): master
sdeleon28
1

votes
1

answer
82

Views

Rebase or Merge into Develop branch? (Small team)

I work in a small team of 5 developers. We are trying to figure out how to keep our development branch as clean and less polluted as possible. Until now, we have been doing this flow: Finish feature (squash all the commits) Checkout to develop branch Pull develop from origin Merge feature branch in...
Luís Cabaço
1

votes
1

answer
83

Views

git rebase interactive, cannot merge binary files, error: could not apply

I created a new repository in my PC, then create file named : foo.txt. So simply, I added text to foo.txt , and commit it. I make let's say 10 commits, every time I added something. Now, I deleted foo.txt and create him again and I write only : 'ver11' and commit it. Now, I want all my changes, to...
Xxsilviox
1

votes
0

answer
380

Views

Git Rebase in jenkins

IN jenkins I have a requuirment that before applying git merge I need to perform a git rebase. Now for git merge I am using jenkins git branch merge option but for git rebase I dont find such functionality in jenkins. SO, do I need to write script for this or is there any option in jenkins which I c...
Stack_IQ
1

votes
1

answer
62

Views

How to rebase branch in IBM Clear Case

My colleague created a feature branch about a year ago and checked in some modification on it. Now I need to continue with it but During the time files was changed on the main branch too. Now I need to rebase feature branch to main latest and merge changes from main to my feature branch. How can I d...
FoxVK
1

votes
0

answer
161

Views

Rebase instead of merge in Xcode 9

I am trying to rebase my local repository from the GitHub but there is no option in the Xcode when I am pulling. In other clients like SourceTree there is this option to be checked. Is there any way to rebase instead of merge on pull?? Thank you in advance!!
PV169
1

votes
0

answer
31

Views

Git rebase: resolve conflicts with merge instead of rebase

In our company, the Git workflow is to delete feature branches after merge, rebase otherwise, to avoid the number of merged feature branches growing in the repo at the expense of readibility. So if we're not interested on all the commits we did to create that feature we do a merge and then we delete...
ABCplus
1

votes
1

answer
39

Views

How to edit master in order to create dev and prevent conflict during merge from dev to master?

I have a master branch. I need to delete CHANGELOG.md and update the version in package.json using value 0.0.0-development and create a dev branch of it. I then need to be able to do change using dev branch, and proceed to a merge to master without having to resolve the conflict for CHANGELOG.md a...
Dimitri Kopriwa
1

votes
1

answer
84

Views

Rebasing with unwanted untracked files. Error merging

I've come across this problem a few times and I have not been able to find an answer yet. Apologies if it turns out to be a duplicate. Suppose I have the three following commits: A -- B -- C (In each commit new files were added). At some point I want to edit commit A, so I rebase -i and mark A for...
MrRed
1

votes
2

answer
75

Views

Changing git history on public branch that was not used by other team members

I created a branch for prototyping a new feature. After several iterations I am happy with the results and want to rebase it to master (or merge, that's not the problem). Some additional information: (1) I already published the branch. For example, I run git push --set-upstream origin my-branch (2)...
Eyal Golan
1

votes
0

answer
26

Views

git rebase results in control characters in file

This just happened to me the second time: I did a git rebase and had to merge the changes by hand. I used meld via get mergetool for this. It worked all well and I committed it and continued the rebase. After that I checked the diff and suddenly there where several control characters in the file and...
Nudin
1

votes
0

answer
68

Views

How to skip merge during `git rebase --continue`

The situation I am trying to reapply my git filters after having identified and resolved unexpected, and undesirable behavior in the previous iteration of the script. I have had to do this once before, and at no point did I get a merge conflict notice. However, now I am and can't figure out how to d...
Nero gris
1

votes
0

answer
35

Views

git pull --rebase=preserve is always rebasing something, even on up-to-date branch

I posted this on [email protected], but did not get any replies so far. Please try the following simple git actions with local repositories: [email protected]:~/test$ git init --bare server Initialized empty Git repository in /home/mmatrosov/test/server/ [email protected]:~/test$ git clone s...
Mikhail
1

votes
1

answer
37

Views

GIT rebase merge branch

I've got problem with GIT. I've got following situation: -> M1 -> M2 -> ............. Ma -> Mb -> Mc [master] \ \ \ \ (merge 'master' to 'merge_branch' without commit 'Mc') \ (create branch 'develop') \ \...
iblis
1

votes
1

answer
39

Views

How to get reference to commits in git

Lets have a git master branch and at some moment lets fork branch for release (release branch will be called R1). Sometimes I need to push commit to both of them(master and R1). Usually I work on master branch, when I'm done I test it, cherry-pick to R1, test it there and push to both of them. I wou...
Ondrej
1

votes
1

answer
46

Views

Rebase a branch checked out from another branch onto master without dragging first branches' commits

I'm wrestling with a particular situation I have with git. In short I am trying to rebase a branch (feature/tracking-refactor) which was checked out from another branch (feature/basic-tracking) which was checked out from origin/master. After merging feature/basic-training I would like to rebase fea...
Mayhem
1

votes
0

answer
24

Views

Merging repositories with file history

I have 3 separate git repos on Bitbucket. I want to merge them all in a single repository, each of them in a separate subdirectory. I managed to do that like this (in an empty repo, after doing the initial commit): 1.git remote add -f old_1 2.git checkout -b old_1 old_1/master 3.mkdir old_1 4.git m...
john doe
1

votes
2

answer
15

Views

Why git rebase replay the feature branch commit one by one?

I am new to git commands and recently came over the git rebase command. I got a doubt regarding why the git rebase command replays the commits of feature branch one by one instead of just replaying the latest commit on the feature branch. This was my scenario on a project where I was working: M1 --...
Pankaj
1

votes
0

answer
46

Views

Possible to git rebase to a text file, edit it and then apply from edited file?

I have to fix a HUGE history (over 300 messages). Obviously, I will have to rebase to root via git rebase -i --root and then reword all commits that need rewording. So you can get grasp of the scope of this work. Is there a way to export git history to a file which I can open via sublime (or other...
sandalone
1

votes
2

answer
47

Views

How to inject a commit between some two arbitrary commits in the past when there is multiple branch above?

The question is an extension of this one: How to inject a commit between some two arbitrary commits in the past? Suppose I have the following commit history on my local-only branch: A -- B -- C -- D \- E How do I insert a new commit between A and B and keep both D and E above C?
jota
1

votes
0

answer
145

Views

How to fix “Unable to unlink old *: No such file or directory”?

I have cloned a branch from a remote repository: git clone -b feature/feature1 http://..... git status On branch feature/feature1 Your branch is up to date with 'origin/feature/feature1' nothing to commit, working tree is clean Now I am trying to use git rebase -i to squash the two last commits: git...
demas
1

votes
1

answer
57

Views

Git - applying commits from one branch onto the other using rebase

For one of our projects we have to use an external companies code base. Once in a while they update their master, which we then have to integrate into our repo. However, because they do some weird/unnecessary stuff we've got a couple of commits we need to apply everytime they update their master be...
Alex
1

votes
2

answer
34

Views

Git rearrange root commit and second commit

I'm learning how to use GIT and Bitbucket. Bitbucket Admin (not me) created a remote repository. In this repository, I have committed my changes 'A' to Master branch ( this is now root/parent/first commit in repository ). Now, I have committed another change 'B' to Master branch. How can I rearrange...
LastPhantom
1

votes
0

answer
18

Views

Rebase private history moving bunch of changes where they logically belong to

Quite often, I make a bunch of commits and review the files later, but before pushing them. This usually leads to a bunch of minor changes like reduced visibility, improved naming, etc. Such changes usually can and should be included into the last commit changing the corresponding file, assuming thi...
maaartinus
1

votes
0

answer
40

Views

How can I insert a commit at a specific history position and rewrite history for all paths?

I want to do what's specifically asked on this question but I want to get it effective for all paths on the git repository, just like you achieve when you perform rewritings with git filter-branch --all. Is that possible with any rebase or filter-branch technique or any third party tool?
Áxel Costas Pena
1

votes
0

answer
24

Views

Git P4 rebase fails with 3 way merge issue

We have recently migrated from p4 to git using git-p4 We have run git-p4 clone //test/path1/[email protected] #and incrementally started doing imports using git p4 rebase //test/path1/[email protected] It has been working fine but off late few engineers started adding and deleting a file say test.sh in both p4 and gi...
Nagendra Reddy
1

votes
1

answer
23

Views

Git: How do I rebase Branch Feature back onto Branch Develop minus Branch MyLocalChanges

We have a develop branch and many feature branches that are created from develop as needed and will eventually be merged back into develop. When I work, I have a set of local changes I like to make, these are changes to settings, changes to scripts, changes to modules, etc. that change various fl...
Jerry Asher
1

votes
0

answer
33

Views

How to amend history commit message without overwriting PRs and changing the authors?

I've googled the method to 'amend history commit' by typing git rebase -i c27f02e , and then change the pick to squash or reword. These operations can successfully amend the history commit messages and combine multiple history commits In the certain repo, since there are commit histories that I merg...
walkcc
1

votes
1

answer
21

Views

collaboration with shallow git clones

How can I create a shallow clone of a single branch that can be pushed to a new remote and later be reintegrated into the original remote? I need to send code to a customer. That customer wants to make changes that I need to integrate into my code base later. However, I cannot give the customer a fu...
Volker Kamin
1

votes
2

answer
22

Views

How to push git snapshots from a private git repository to public git repository?

I have two git repos: A private one for the developers and their daily commits And a public one for public releases. Whenever I want to release code I want to push a snapshot of the developer repo to the public repo. Since the developer repo might contain some commit messages which are not suitable...
nightshift
1

votes
0

answer
33

Views

How to change a line in Git but keep the original author for that line?

I have changed some eslint rules for our team. One member of the team raised a PR that had ran prettier --fix on the entire codebase. We currently have lint-staged so only files that have been actively changed will get these updated eslint/prettier rules applied to them. I wondered, is it possible t...
Jamie Hutber
1

votes
1

answer
22

Views

Is there a circumstance where you will rebase your local repo and then push instead of push force?

My company is working to transition into using Git and we are currently working on the workflow. After rebasing a feature branch onto master, would you always use git push origin feature-branch -f or is there a circumstance where git push is sufficient? We are attempting to understand rebasing and h...
Alex

View additional questions