# Feature: checkout and merge

3 messages from 2020-10-12 to 2020-10-12. Participants: Victor Porton, Konstantin Tokarev, Junio C Hamano.
Thread: https://gitlist.dev/t/54395

## Victor Porton, 2020-10-12 11:05

Subject: Feature: checkout and merge
Message-ID: <28a86c75-de4d-acbe-dab7-e5512961538c@narod.ru>
URL: https://gitlist.dev/e/28a86c75-de4d-acbe-dab7-e5512961538c%40narod.ru

```
It is a very often need to checkout a branch and them merge the branch
that was before the checkout. Moreover after this is very often needed
to push.

So please add the flags to `checkout`:

1. to merge the old branch immediately after checkout

2. to push after checkout

I repeatedly write:

git checkout stable && git merge main && git push && git checkout main

(I am not subscribed to this mailing list.)



```

## Konstantin Tokarev, 2020-10-12 15:04

Subject: Re: Feature: checkout and merge
Message-ID: <5293161602514983@mail.yandex.ru>
URL: https://gitlist.dev/e/5293161602514983%40mail.yandex.ru
In-Reply-To: <28a86c75-de4d-acbe-dab7-e5512961538c@narod.ru>

```


12.10.2020, 14:12, "Victor Porton" <porton@narod.ru>:
> It is a very often need to checkout a branch and them merge the branch
> that was before the checkout. Moreover after this is very often needed
> to push.
>
> So please add the flags to `checkout`:
>
> 1. to merge the old branch immediately after checkout
>
> 2. to push after checkout
>
> I repeatedly write:
>
> git checkout stable && git merge main && git push && git checkout main
>
> (I am not subscribed to this mailing list.)

Why not make a shell script to do this?


-- 
Regards,
Konstantin

```

## Junio C Hamano, 2020-10-12 17:48

Subject: Re: Feature: checkout and merge
Message-ID: <xmqqo8l7pc7w.fsf@gitster.c.googlers.com>
URL: https://gitlist.dev/e/xmqqo8l7pc7w.fsf%40gitster.c.googlers.com
In-Reply-To: <5293161602514983@mail.yandex.ru>

```
Konstantin Tokarev <annulen@yandex.ru> writes:

> 12.10.2020, 14:12, "Victor Porton" <porton@narod.ru>:
>> It is a very often need to checkout a branch and them merge the branch
>> that was before the checkout. Moreover after this is very often needed
>> to push.
>>
>> So please add the flags to `checkout`:
>>
>> 1. to merge the old branch immediately after checkout
>>
>> 2. to push after checkout
>>
>> I repeatedly write:
>>
>> git checkout stable && git merge main && git push && git checkout main
>>
>> (I am not subscribed to this mailing list.)
>
> Why not make a shell script to do this?

Sounds like a very sensible suggestion.  "merging and then pushing
immediately after" without any validation step in between is not for
everybody and being able to implement such a custom workflow is why
we have these individual steps as discrete commands.

Thanks.

```
