Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I git checkout from GitHub Desktop?

Is there a way to rewrite repository directory files to current branch state in GitHub Desktop?

Or can I only do it from command line with git checkout mybranch

and does GitHub Desktop keep all files of all branches in directory?

like image 990
tandav Avatar asked Oct 18 '22 23:10

tandav


2 Answers

I will describe how to checkout on GitHub Desktop, which is equivalent to merging you current branch with the master branch. There are four steps you take(Branch names have been blanked out for privacy).

  1. Go to the tab that shows the current branch.

enter image description here

  1. Change the current branch to the Master branch.

enter image description here

  1. Go back to the tab (now with master branch as current) and at the bottom click on "Choose the branch to merge with master".

enter image description here

  1. On the screen that comes up chose the branch that you have been working on and click on merge with master.

enter image description here

These steps assume that you have pulled all the changes on the master into your current branch to avoid any conflict. If there are issues try to ensure that the branch you are working on has been updated by changes in the Master.

like image 181
Vectoria Avatar answered Oct 30 '22 03:10

Vectoria


To do git checkout mybranch on Github Desktop, you simply click on the dropdown menu on the upper left hand corner of the client, and pick the branch you want to switch to. It manages files exactly like git does, so all files are stored in their respective branches.

like image 28
t_huang Avatar answered Oct 30 '22 02:10

t_huang