Tag: rebase

How to protect a local master branch from being rebased?

I want to protect a specific local branch (e.g. master) from being rebased accidentally. I know how to do this on the server side. Bitbucket has a configuration as shown in the screenshot. How can I protect a local branch (e.g. master) from being rebased as in …? $ git rebase feature master

Is it possible to squash commits without changing the commit's hash?

I forgot to add a file to a commit that I have already pushed and created a pull request for. The pull request got rejected (because of other reasons). I now want to add the missing file to the original commit and then perform the requested changes in a new commit before issuing a new […]

Safe to git rebase new local branch using various remote commits?

Assume I have a local repo which is completely up-to-date with origin. Is it safe to create a new branch from a specific SHA and then do all the rebasing I want of my new branch against other branches/SHAs which exist on origin? git checkout -b merging_some_commits bfd70a83f5bf3f7fd44422233a82751535428cbd git rebase –onto some_other_branch 02979b4e34809d53e5071501046f59ad5c git checkout […]

git rebase strange behavior

I have strange git rebase behavior for next example. Suppose, I have the local tree: ∨ b1–b2–b3 / a1–a2–a3 and the remote tree b1–b2–b3 / a1–a2–a3–a4–a5–a6 where the branch a is master and at the current time, I am being at the b3. I call the next commands: git pull origin master master // fixed […]

Git rebase instead of merge, the correct way to do it?

I would like to avoid recurrent branches intersections on my remote repository by using a rebase instead of a merge. To give you a better understanding of what I would like to achieve, please consider the following situation: $ git lg * 2345678 hotfix (HEAD -> master) * 1234567 foo (origin/master, origin/HEAD) $ git push […]

after rebasing on a branch, how to update master to match that rebased branch?

I’ve done a bunch of rebasing on a test GIT branch. The rebasing was done for two reasons: #1: to integrate changes in a parent git-svn trunk; #2: to clean up my local history in preparation for handing off the code to another developer. I have my test branch the way I want it, all […]

Git: Rebase or Merge to update a local branch

Alright, I have a development branch that is tracked remotely and shared by everyone on this project. Locally I have branched off of this to do some ongoing work. However, in the mean time another developer has committed and pushed changes to the development branch that I would like reflected in my local branch. Is […]

Is it possible to easily move all commits from one branch onto another as one commit?

This question already has an answer here: Squash my last X commits together using Git 18 answers

Git pull –rebase when push

I’d like to know if it would be possible with git to auto pull –rebase when doing git push ? I mean if git push is rejected, automatically do a git pull –rebase and then git push again so I don’t need to do that manually each time someone push before me. Thanks for your […]

GIT – Rebase – How to deal with conflicts

I am working on a project that has two branches: master and feature The feature branch was created some time ago and has numerous commits. Since the feature branch was created there have been a couple of commits to master At this point when I go to rebase off of master I get conflicts. I […]

Git Baby is a git and github fan, let's start git clone.