Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| github-desktop [2021/11/03 00:54] – atari | github-desktop [2023/04/27 02:37] (current) – [Make a pull request] update tip about new feature atari | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Github Desktop ====== | ====== Github Desktop ====== | ||
| - | |||
| - | <WRAP center round todo> | ||
| - | Under construction. | ||
| - | </ | ||
| Github released a neat GUI for managing local repositories with '' | Github released a neat GUI for managing local repositories with '' | ||
| Line 20: | Line 16: | ||
| {{: | {{: | ||
| + | |||
| + | === Note for Windows users === | ||
| + | |||
| + | Windows users should take some extra precautions when editing Linux-spawned files. NTFS, the default filesystem for Windows, does not support many features that the more modern filesystems Linux supports such as symlinks, file attributes (including the extremely important executable bit), etc. By default, Git will do its best to transparently convert file attributes to and from Windows-acceptable formats to the ones on the remote repository, but edits are not always possible (such as with two symlinked files). | ||
| + | |||
| + | Windows' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Then also tell `git` to not automatically convert LF to CRLF by adding the following to your '' | ||
| + | |||
| + | < | ||
| + | [core] | ||
| + | autocrlf = input | ||
| + | </ | ||
| + | |||
| + | You can enable experimental symlink support within Windows by installing the [[https:// | ||
| + | |||
| + | < | ||
| + | [core] | ||
| + | symlinks = true | ||
| + | </ | ||
| + | |||
| + | <WRAP center round info> | ||
| + | If you already have a repository setup and are simply transitioning over to Github Desktop, you'll also need to erase the '' | ||
| + | </ | ||
| + | |||
| + | Once this is done, change Github Desktop' | ||
| ==== Mac ==== | ==== Mac ==== | ||
| - | FIXME | + | Easy: |
| + | - Go to [[https:// | ||
| + | - Click " | ||
| + | - Double-click '' | ||
| + | - Follow the on-screen instructions | ||
| ==== Linux-based distributions ==== | ==== Linux-based distributions ==== | ||
| Github Desktop does not official support any Linux-based distributions, | Github Desktop does not official support any Linux-based distributions, | ||
| + | |||
| + | In the case that you are using a distribution that cannot install '' | ||
| + | |||
| + | <WRAP center round info> | ||
| + | On that note, since Github Desktop uses Electron, it doesn' | ||
| + | </ | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | On Solus, using the AppImage is recommended. Download it and mark it as executable. Installing Chrome (from the third party section in the software updater) is required to authenticate the sign-in. <wrap lo>You don't actually need to use Chrome itself to do the authentication, | ||
| + | </ | ||
| ===== Setting up Github Desktop ===== | ===== Setting up Github Desktop ===== | ||
| Line 38: | Line 76: | ||
| {{: | {{: | ||
| + | |||
| + | <WRAP center round help> | ||
| + | If having difficulty getting your browser to recognize the protocol (either due to weird permission issues or manual installation), | ||
| + | |||
| + | If it's still failing after that, it is possible to copy and paste a known-working configuration folder from another operating system into the one you are having the difficulties with. | ||
| + | |||
| + | * Windows config folder: '' | ||
| + | * Linux config folder: '' | ||
| + | |||
| + | Make sure GitHub Desktop is closed before doing this. | ||
| + | </ | ||
| + | |||
| + | ==== Fixing submodule downloading ==== | ||
| + | |||
| + | Batocera makes ludicrous use of submodules to compile. You'll find that when attempting to make new branches, they' | ||
| + | |||
| + | < | ||
| + | [submodule] | ||
| + | recurse = true | ||
| + | </ | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | This can also be achieved by running '' | ||
| + | |||
| + | In a typical Windows installation of Github Desktop, this is at '' | ||
| + | </ | ||
| ==== Clone the repository ==== | ==== Clone the repository ==== | ||
| Line 45: | Line 109: | ||
| {{: | {{: | ||
| - | If you've already forked the project, great! Just click it here and clone it, choosing to contribute to the parent project. Otherwise, click on **URL** at the top to switch to another screen. | + | If you've already forked the project, great! Just click it here and clone it, choosing to contribute to the parent project. |
| + | |||
| + | Otherwise, click on **URL** at the top to switch to another screen. | ||
| Enter the URL of the repository you want to clone. Here, I will be copying the [[https:// | Enter the URL of the repository you want to clone. Here, I will be copying the [[https:// | ||
| - | {{: | + | {{: |
| Select your desired folder and click **Clone**. Please wait patiently while the repository is downloaded to your computer. | Select your desired folder and click **Clone**. Please wait patiently while the repository is downloaded to your computer. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | When asked what project you'd like to contribute to, select the one hosted by batocera.linux, | ||
| + | |||
| + | ==== Create a new branch ==== | ||
| Nice! Now we have the repository on our computer. The default branch is '' | Nice! Now we have the repository on our computer. The default branch is '' | ||
| - | {{: | + | {{: |
| It's useful to give the branch a meaningful, one-or-two word name. I'm intending on making edits to the readme file, so I'm going to name my branch '' | It's useful to give the branch a meaningful, one-or-two word name. I'm intending on making edits to the readme file, so I'm going to name my branch '' | ||
| <WRAP center round tip> | <WRAP center round tip> | ||
| - | Note that branch names have limitations, and no two branches can have the same name; Github Desktop will inform you of this and make the appropriate changes as needed. | + | Note that branch names are limited to alphanumeric, |
| </ | </ | ||
| - | Now this branch is stored locally on our computer, but it doesn' | + | Now this branch is stored locally on the computer, but it doesn' |
| + | |||
| + | {{: | ||
| + | |||
| + | But you'll notice that this will partially fail as you don't have write access to the Batocera-owned repository! You'll be offerred to create your own fork of the repository to make your edits to, click **Fork this repository**: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | <WRAP center round info> | ||
| + | If you're cloning an already forked project, this step will not occur. | ||
| + | </ | ||
| + | |||
| + | You'll then be asked how you'd like to use the project. Leave it on **To contribute to the parent project** pointed at batocera.linux and click **Continue**: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | You'll be taken back to the main page. Click **Publish branch** again, and this time everything will be successful! | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Your files are now ready to be edited. | ||
| + | |||
| + | ==== Editing files ==== | ||
| + | |||
| + | Click on **Show in Explorer** (or the name of your preferred file manager if you have something different from default) to open up a folder directly to your repository and start editing away! You have some guidelines on [[: | ||
| + | |||
| + | ==== Committing changes ==== | ||
| + | |||
| + | You'll notice that as you edit files, the files you edit and changes you've made will appear in Github Desktop: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | You can make as many edits as you'd like. Once you are ready to commit your changes to the fork, fill out the details of the changes you've made in the description box at the bottom left of the screen and click **Commit to < | ||
| + | |||
| + | {{: | ||
| + | |||
| + | The commit is now saved locally to your repository, but has yet to be pushed to your remote fork. Click on **Push origin** to do so: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ==== Make a pull request ==== | ||
| + | |||
| + | Once your changes are committed, click on **Create Pull Request** to open your web browser to make a pull request on Github itself. | ||
| + | |||
| + | {{: | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | New feature: Pull request changes can be previewed in Github Desktop before going to the web page to preview it. This can be useful, but it's not needed right now. Click the down arrow next to the **Preview Pull Request** to switch it back to **Create Pull Request**. | ||
| + | </ | ||
| + | |||
| + | Github is smart enough to automatically insert the title and description you entered for the commit you made earlier, but do note that this is only for the first commit you made. If you've made multiple commits, make sure to double check the fields here. | ||
| + | |||
| + | It is recommended to switch this to a **Draft Pull Request** until you've become more familiar with the process. This will allow you to make mistakes without worry until you click **Ready for review**. First click the down arrow and select **Create draft pull request**: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | You'll notice that the button now says "Draft pull request" | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Yay! | ||
| + | |||
| + | {{: | ||
| + | |||
| + | <WRAP center round info> | ||
| + | A pull request can only be done via the web page, there is no way to do this from Github Desktop itself. This is by design. | ||
| + | </ | ||
| + | |||
| + | When you're ready to submit your changes, click **Ready for review**. | ||
| + | |||
| + | ==== I messed up and need to change something ==== | ||
| + | |||
| + | Don't fret, you can still make changes to your pull request //as long as it hasn't been merged yet// (a draft pull request indicates it is not ready to be merged yet). Ensure that you're on the branch that you made the pull request from, make your additional changes, and commit them again. The changes will be reflected in the pull request immediately. | ||
| + | |||
| + | If you've ended up making many commits, it is polite to " | ||
| + | |||
| + | To squash multiple commits into one: | ||
| + | - Ensure you're still on the branch you have made the pull request on | ||
| + | - Click on **History** near the top left of the window | ||
| + | - Select the commits you wish to squash (either by holding '' | ||
| + | - Right-click and select **Squash <#> commits** {{: | ||
| + | - Create a new title and description that includes all your changes\\ {{: | ||
| + | - Click **Force push origin**\\ {{: | ||
| + | - Confirm the changes have been reflected in the pull request\\ {{: | ||
| + | |||
| + | ==== Fetch upstream changes ==== | ||
| + | |||
| + | In order to keep your local master branch in sync with changes made to the upstream master branch, you'll have to fetch the changes. Normally, you would just click **Fetch origin** at the top to do so, but if you do that you'll notice something after a while. On your Github Desktop, it will claim that there are no changes: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | But if you visit the fork on your Github webpage: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | To repair this, there are multiple methods: | ||
| + | |||
| + | === Just use batocera.linux' | ||
| + | |||
| + | This is the simplest solution, just use batocera.linux' | ||
| + | |||
| + | * Renaming the '' | ||
| + | * Deleting the '' | ||
| + | |||
| + | To do the latter, first be on a branch that isn't master, then right-click the local '' | ||
| + | |||
| + | === Merging/ | ||
| + | |||
| + | Similar to the command line procedure, we will merge directly from upstream. If you choose to use this method, this needs to be done every time you want to sync with upstream. | ||
| + | |||
| + | == Using Github Desktop == | ||
| + | |||
| + | Merge the upstream/ | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Then push your changes to your remote fork by pushing the commits. This will be your " | ||
| + | |||
| + | == Using Github webpages == | ||
| + | |||
| + | Navigate to '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | You will need to [[# | ||
| + | |||
| + | == Confirm fork has been updated == | ||
| + | |||
| + | You can check that the remote is up to date by checking your fork online at Github: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | === Redirecting the local master branch header === | ||
| + | |||
| + | Instead, you can edit the branch settings for your '' | ||
| + | |||
| + | Change the currently tracked upstream branch by running the command '' | ||
| + | |||
| + | On Windows: | ||
| + | - Open '' | ||
| + | - Press '' | ||
| + | - Run '' | ||
| + | - Then run '' | ||
| + | |||
| + | <WRAP center round info> | ||
| + | If you use this method, your fork online will not be updated in sync with your local branch. This does not matter, as all your new branches will be based on upstream/ | ||
| + | </ | ||
| + | |||
| + | === Fetch the changes === | ||
| + | |||
| + | After updating the fork online or editing the branch settings, simply click **Pull upstream**/ | ||
| + | |||
| + | {{: | ||
| - | {{: | + | ==== Making new changes ==== |
| - | But you'll notice | + | Now that you've got everything set up making new changes in the future is much simpler: |
| + | - [[# | ||
| + | - [[# | ||
| + | - [[# | ||
| + | - [[# | ||
| + | | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| Line 75: | Line 304: | ||
| ==== I can't sign in/ | ==== I can't sign in/ | ||
| - | Try resetting your username and authentication token by going to **File** -> **Options** -> **Accounts** -> **Sign Out**, then signing in again. | + | Try resetting your username and authentication token by going to **File** -> **Options** -> **Accounts** -> **Sign Out**, then signing in again. You may also need to explicitly sign out of Github on your web browser to get it to regenerate a new, valid token. |
| ==== Other/more complicated issues ==== | ==== Other/more complicated issues ==== | ||
| - | Refer to [[https:// | + | Refer to [[https:// |
- github-desktop.1635900849.txt.gz
- Last modified: 5 years ago
- by atari