# How juggle branches?

4 messages from 2018-01-29 to 2018-02-08. Participants: Andrzej, Patryk Obara, Stephen R Guglielmo.
Thread: https://gitlist.dev/t/47716

## Andrzej, 2018-01-29 21:24

Subject: How juggle branches?
Message-ID: <29b0272d-7854-592d-5e1c-3a4f0d347bd1@wp.pl>
URL: https://gitlist.dev/e/29b0272d-7854-592d-5e1c-3a4f0d347bd1%40wp.pl

```
First, I develop program which uses mysql in branch master.
Next i change name this branch to before_hbase, and began develop HBase 
in branch master. I also develop before_hbase.
Now, instead HBase will be MapR-DB which will before_hbase , not master 
succesor.
How do:
- change before_hbase to master
- old master to hbase
- develop MapR in mapr branch
?
I am in master branch and am changing to hbase:
git checkout -b hbase
git push origin hbase

now worse:
I am in branch before_hbase and need change to master
git checkout -b master  - not works because master exists

I must use rebase? I hear, that rebase can be used only in private 
(.git), not github repositories.
If I change to master and copy files and next commit - change will not 
atomic.

```

## Patryk Obara, 2018-01-30 00:16

Subject: Re: How juggle branches?
Message-ID: <1fd71dd9-f54a-16dc-5521-f6f4e7d6fc33@gmail.com>
URL: https://gitlist.dev/e/1fd71dd9-f54a-16dc-5521-f6f4e7d6fc33%40gmail.com
In-Reply-To: <29b0272d-7854-592d-5e1c-3a4f0d347bd1@wp.pl>

```
On 29/01/2018 22:24, Andrzej wrote:

> I am in master branch and am changing to hbase:
> git checkout -b hbase
> git push origin hbase

These two commands create new branch called "hbase" in your local repo,
and then in remote repo - so probably not what you wanted to do.

> now worse:
> I am in branch before_hbase and need change to master
> git checkout -b master  - not works because master exists

"git checkout -b name" creates new branch called "name", starting in 
your latest commit and switches you to this new branch.

"git checkout name" switches your working tree to branch "name".

So just drop "-b". You can read more in manual for git-checkout:
https://git-scm.com/docs/git-checkout

(in polish) Jeśli masz jakieś konkretne pytania, to możesz napisać do
mnie po polsku :).

-- 
| ← Ceci n'est pas une pipe
Patryk Obara

```

## Andrzej, 2018-02-08 14:03

Subject: Automatic parameters completion
Message-ID: <131f3b0f-0002-2823-d64b-ffd16fff8dfa@wp.pl>
URL: https://gitlist.dev/e/131f3b0f-0002-2823-d64b-ffd16fff8dfa%40wp.pl
In-Reply-To: <29b0272d-7854-592d-5e1c-3a4f0d347bd1@wp.pl>

```
I have Linux Mint and its terminal besides usual completion (add file 
name when type first letter and press tab) also can complete git 
parameters. How is doing this? Bash knows git or bash has special 
interface to completion and git uses it?
I want in my Linux program apply this mechanism.

```

## Stephen R Guglielmo, 2018-02-08 14:22

Subject: Re: Automatic parameters completion
Message-ID: <CADfK3RWXJyFWPUds1Q2qQS-w-Kwh8jKmO9VWCAgueo434LSYcg@mail.gmail.com>
URL: https://gitlist.dev/e/CADfK3RWXJyFWPUds1Q2qQS-w-Kwh8jKmO9VWCAgueo434LSYcg%40mail.gmail.com
In-Reply-To: <131f3b0f-0002-2823-d64b-ffd16fff8dfa@wp.pl>

```
On Thu, Feb 8, 2018 at 9:03 AM, Andrzej <borucki_andrzej@wp.pl> wrote:
> I have Linux Mint and its terminal besides usual completion (add file name
> when type first letter and press tab) also can complete git parameters. How
> is doing this? Bash knows git or bash has special interface to completion
> and git uses it?
> I want in my Linux program apply this mechanism.

Various shells include support for completion of git parameters. These
completion functions may be enabled by default in your distribution.
For example, zsh has vcs_info[1]. There are also scripts included in
git (contrib/completion) [2] to do this.

[1] http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Information
[2] https://github.com/git/git/tree/master/contrib/completion

```
