# What's the best thing to do (git vtk)

**URL:** https://discourse.vtk.org/t/whats-the-best-thing-to-do-git-vtk/5261
**Category:** Development
**Created:** [February 26, 2021, 11:43am UTC](https://discourse.vtk.org/t/whats-the-best-thing-to-do-git-vtk/5261 "2021-02-26T11:43:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [February 26, 2021, 11:43am UTC](https://discourse.vtk.org/t/whats-the-best-thing-to-do-git-vtk/5261/1 "2021-02-26T11:43:03Z")

</div>

@mwestphal

As can be seen from this [MR](https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7656), my branch is quite old and lags behind master by 251 commits.

I am a first-time contributor and would like to get advice on the best thing to do here.  
Should I carry on with new developments to it? Or Should I make a new fork? What is suggested?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [February 26, 2021, 11:45am UTC](https://discourse.vtk.org/t/whats-the-best-thing-to-do-git-vtk/5261/2 "2021-02-26T11:45:19Z")

</div>

I suggest that you rebase against master. Once you commit into your local branch:

git fetch origin  
git rebase -i origin/master

One this is completed, you’ll have to force push to gitlab:  
git gitlab-push -f

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 26, 2021, 11:46am UTC](https://discourse.vtk.org/t/whats-the-best-thing-to-do-git-vtk/5261/3 "2021-02-26T11:46:35Z")

</div>

Just rebase your branch on master as I suggested.

```
cd vtk
git fetch origin
git checkout master
git pull
git checkout feature-inside-out-cookiecutter
git rebase -i master
< check that the list of commits is correct and quit your editor >
git push gitlab -f

```

Edit: @will.schroeder nice cross post 🙂

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [February 26, 2021, 12:28pm UTC](https://discourse.vtk.org/t/whats-the-best-thing-to-do-git-vtk/5261/4 "2021-02-26T12:28:56Z")

</div>

Thanks all, its done. 🙂

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [February 26, 2021, 3:39pm UTC](https://discourse.vtk.org/t/whats-the-best-thing-to-do-git-vtk/5261/5 "2021-02-26T15:39:47Z")

</div>

Just FYI - GitLab has a relatively new feature that enables rebasing on the target branch of a merge request. You can add a command comment to the MR to kick off a rebase right on the server. Just type `/rebase` and add the comment, then wait a minute. If there are no conflicts, your MR will be rebased.

On your local VTK repository, you can grab the newly rebased branch with `git gitlab-sync`.
