Kong / Kong/insomnia

Checking out remote branch does not work

Open
#3,263 7 comments 2 reactions 0 assignees View on GitHub
A-git-sync B-bug needs-triage S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

**Describe the bug**
When clicking the checkout button for a remote branch that branch is not correctly checked out. A new local branch is created based on master, not the remote branch.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a remote branch with at least two commits that are not in master.
2. Open the Branches window in the git menu
3. Click the checkout button on the remote branch created above
4. Note that changes in the branch are not displayed in the UI
5. Click Help > Show App Data Folder
6. Navigate to Insomnia/version-control/git/[repo id]/git
7. Run `git log` in that folder
![image](https://user-images.githubusercontent.com/48921597/113604359-05680d80-95fa-11eb-89f6-3aa425fe8998.png)
8. Run `git log origin/`
![image](https://user-images.githubusercontent.com/48921597/113604538-49f3a900-95fa-11eb-99e8-50e439959b68.png)

**Expected behavior**
When you click the checkout button the local branch is created based on the contents of the remote branch, not master

**Desktop (please complete the following information):**
- OS: Windows 10
- Installation Method: windows installer
- App Version: 20221.2.1

**Additional context**
If the remote branch is only 1 commit ahead of master this issue can be resolved by pulling. If the branch is 2 or more commits ahead the pull fails with the following error:
![image](https://user-images.githubusercontent.com/48921597/113605573-b327ec00-95fb-11eb-9e75-368d5dd5c097.png)

Contributor guide

Open the contributing guide

Research direction

Reproduce the checkout from the Branches window using a remote branch with at least two commits not in master. Inspect the repository under Insomnia/version-control/git/[repo id]/git and compare `git log` with `git log origin/`. Done means the local branch contains the remote branch's commits and its changes appear in the UI after checkout.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.