Cloning a remote repository with Git GUI ( How to download branches? )

NullPointerException picture NullPointerException · Jan 18, 2017 · Viewed 8.4k times · Source

I'm testing Git GUI software (windows version). I cloned a remote repository and now, I only have master branch selectable on my local repo using Git GUI.

In the remote repo there is a "dev" branch too, but it is not selectable locally. Is this a bug or is the normal behaviour? I'm searching for the best way to get access to "dev" branch locally.

Thank you

Answer

Marina Liu picture Marina Liu · Jan 18, 2017

You should checkout to origin/dev and then create a local branch dev. Steps as below:

Git GUI -> branch Tab -> checkout -> Tracking branch -> select origin/dev -> checkout -> branch Tab -> create -> name for dev and select this detached checkout -> create.

Now you have a local dev branch the same as remote. You can check the history by repository Tab -> visualize dev's history.

You can also commit changes for dev branch and push to remote dev branch.