1. How to Github Desktop - CK3RealmsinExile/RealmsInExile GitHub Wiki

Getting Github Desktop

WIP By this point you should already have this but in case you don't, you need to follow the following steps;

  1. Download and follow the instructions to install GitHub Desktop.

  2. Clone the repository "https://github.com/jj248/RealmsInExile". You can drag and drop the URL of the Realms repository below, into GitHub Desktop. Some of the team put theirs into \Documents\Paradox Interactive\Crusader Kings III\mod\git for easy access. Note that this is an open project so please do not publicize or share it outside of this group - doing so will have you banned from the server.

WIP more stuff to be added

How to Navigate Github Desktop

So here is Github Desktop image

Here you can see there are plenty of commits. A commit tells Git that you made some changes to files in your repository and you want to record those changes. By looking at the example bellow we can see that by me changing and adding new code (localizations for harad in this case) i've made it into a commit and added it into the repository. image

Uploading to the Git

Commit in GitHub Desktop

By to go through this progress let's make use of this example; To make our first commit, we first need to modify one of the files in our repository.

Navigate to the codecademy-git-test folder on your Desktop (or wherever you chose to locate it). You’ll notice that the only file contained in this folder is a README.md file.

Open this file with your preferred text or code editor and write a personalized message. For instance, we can write the following: image

Once you have finished your edits, save the README file and return to the GitHub Desktop application. You’ll notice that GitHub Desktop has already recognized the changes made to your file.

To commit these changes, we should first write a commit message on the bottom left of the screen. In this example, “Update README.md” is an appropriate commit message.

When we’re ready to commit, we can simply click “Commit to main.” image

Congratulations! You just learned how to perform a Git commit using GitHub Desktop.

Your commit is currently local to your computer. If you want the changes to the README file to show on GitHub, you must click “Push origin” on the next screen: image

Now when you navigate to your codecademy-git-test repository on github.com, you should see your updated README file: image

Fetch in GitHub Desktop

When you collaborate with other people on a repository, you will want to see what everyone is working on and update your files with the most up-to-date changes.

In Git, fetching is the process of updating your files with the most recent changes. Luckily, GitHub Desktop makes fetching changes easy.

Let’s suppose that someone made an update to our README file from the previous example. The README file now looks like this: image

In order to fetch these changes in GitHub Desktop, we can simply click the “Fetch origin” button: image

Next, you should click “Pull origin” so that the changes are reflected in the files on your local machine: image

Now, navigate to the codecademy-git-test folder on your Desktop (or wherever you chose to locate it). If you open the README file, you will notice that the changes made to the file are correctly shown: image

Work in Progress - how github desktop looks and how to find stuff.

Master, Branches and more Branches

So the Master Branch is the Main place where the main code is stored in.

You can create other Branches though in the Git from the Master one. Branches allow you to develop features, fix bugs, or safely experiment with new ideas in a contained area of your repository.

You always create a branch from an existing branch. Typically, you might create a new branch from the default branch of your repository. You can then work on this new branch in isolation from changes that other people are making to the repository. A branch you create to build a feature is commonly referred to as a feature branch or topic branch. For more information, see "Creating and deleting branches within your repository."

Creating a branch

  1. On GitHub.com, navigate to the main page of the repository.
  2. From the file tree view on the left, select the branch dropdown menu, then click View all branches. You can also find the branch dropdown menu at the top of the integrated file editor.
Click to expand

image

  1. Click New branch.
Click to expand

image

  1. Under "Branch name", type a name for the branch.

  2. Under "Branch source", choose a source for your branch.

    • If your repository is a fork, select the repository dropdown menu and click your fork or the upstream repository.
    • Select the branch dropdown menu and click a branch.
  3. Click Create branch.

Merging Branches

Once you're satisfied with your work, you can open a pull request to merge the changes in the current branch (the head branch, being purple in the example bellow) into another branch (the base branch, being yellow in the example bellow). For more information, see "About pull requests."

Click to expand

image Green being the Master and the yellow circle is an example of an "base" branch with purple being a "head" branch you work on that you want to incorporate into the "base" branch.

Here someone has created a branch called feature1 from the main branch, and you've then created a branch called feature2 from feature1. There are open pull requests for both branches. The arrows indicate the current base branch for each pull request. At this point, feature1 is the base branch for feature2. If the pull request for feature2 is merged now, the feature2 branch will be merged into feature1.

image

Sometimes you need to have permissions to add stuff and branches to other main/base branches. (more shit here)

Updating your branch with the Base Branch stuff Another good thing is that if another branch get's added to the Base branch and you would want to utilize that code you can grab that update to the base branch into your Pull Request Branch. To do this you need to;

  1. On Diskhub Desktop go to the Bar beneath Changes and History that says "Select Branch to Compare..."
Click to expand

image "Select Branch to Compare..."

  1. The select a branch or the Base branch that your most likely made a branch off
Click to expand

image Showing what happens when clicking on "Select Branch to Compare..." and what to choose.

  1. Then you can see what's different from the base branch and what will be added to your branch if you would choose so by clicking on Create a Merge commit
Click to expand

image

  1. then it will show you that your up to date and then you need to push to finalize the Merger
Click to expand

image

And with that you should have successfully Updated your branch

Pull Requests

Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch, as it will also tell you if your branch is causing a problem for the main branch

An example is here on the Pull Request V4 development - Umbrella-Near Harad faith #971 image

The Conversations is a page that is your basic Issue but also shows each commits that been made to the Pull Request

The Commits is a page that shows all commits that has been made to the Pull Request

Click to expand

image example of The Commits that's been made on the V4 development - Umbrella-Near Harad faith #971

The Checks to be written

The File Changes shows the actual code and changes that have been added that differs from the base branch. and while commits kind of does that to, commits can change stuff to each other while the File changes will always shows whats on the actual Pull Request

Click to expand

image example of The File Changes on the V4 development - Umbrella-Near Harad faith #971

Another good thing about the **File Changes** is that you can write code easier by going to this page if you dont want to go into the files directly, so if you need to do an easy tweak then this would be optimal for that.

Another thing Pull Requests is good for is that you can apply reviewers or possible only granting permission to merge with an administrator agreeing to it, so that only approved branches get onto the base branch, avoiding bugs and broken code.

How to Create a Pull Request?

  1. On GitHub.com, navigate to the main page of the repository.
  2. In the "Branch" menu, choose the branch that contains your commits.
  3. Above the list of files, in the yellow banner, click Compare & pull request to create a pull request for the associated branch.
  4. Use the base branch dropdown menu to select the branch you'd like to merge your changes into, then use the compare branch drop-down menu to choose the topic branch you made your changes in.
  5. Type a title and description for your pull request.
  6. To create a pull request that is ready for review, click Create Pull Request. To create a draft pull request, use the drop-down and select Create Draft Pull Request, then click Draft Pull Request. For more information about draft pull requests, see "About pull requests."
⚠️ **GitHub.com Fallback** ⚠️