Checking out remote branch does not work
- 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

8. Run `git log origin/`

**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:

Contributor 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