Skip to content

JACGWD/Using-GitHub-Desktop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using GitHub Desktop

Instructions for beginner GitHub Desktop users

GitHub Desktop Explained

GitHub Desktop is an application used to:

  • Sync files between members on a team where people can be in different physical locations.
  • Make sure all team members have the latest version of any file in the project.
  • Propose changes to someone else's code.
  • Manage the entire coding project, including:
    • stable features (old, known-good code)
    • work-in-progress (not-yet-good code)
    • all proposed new features (new code)
  • Serve as the in-between between VS Code and the Git repository server.

GitHub Desktop is not used to:

  • Write code.
  • Read code.

In Class Workflow

In normal class situations, the following tasks are the most frequent:

1. Clone a Repo

"Adding a Repo" means that you are choosing a folder of code to sync to your own machine. For example, the GWD GitHub has many folders of code (most of theme written in Markdown) that display as web sites.

Go to GitHub and find a repo of interest

GWD department repositories page

Find the green Code button and copy the git url

GWD department repositories page

In GitHub Desktop, click Add... Clone Repository

Clone a repo in GitHub Desktop

Paste the git url anc click Clone

Clone a repo in GitHub Desktop

2. Select a Repo

In GitHub Desktop, clicking the top left corner lets you see the list of repositories on your system

Available repos in GitHub Desktop

3. View the Repo

3a. To see the code presented as a web page (for easy reading), right-click the top left part of GitHub Desktop's main window and select "View on GitHub".

View on GitHub

3b. To see the Markdown file saved on your local computer but previewed as a web page: In VS Code, hit command-shift-P to open the Command Palette, start typing "preview", and select Markdown: Open Preview.

All the web page-like pages on GitHub are written in Markdown. All you need to do is open the file in VS Code and preview it as HTML.

Open in VS Code

Open Markdown as html preview

4. Pull Any Changes

If the master repository (online) has any changes, you need to sync your local copy by "pulling" changes from the server.

GitHub fetch changes

5. Push Any Changes

If you are making changes to a repository that you own, you can make changes and "push" them to the server by making a "commit".

Commit changes

6. Propose Changes to Someone Else's Repo

The heart of open source software development is many people contributing to a project. If you want to make a change to someone else's code, you can. It is a two step process:

  1. "Fork" the repo. This creates a different branch where you can make changes.
  2. Submit a "pull request" to have your changes merged into the main branch.

Troubleshooting Issues

What to do if your theme is not syncing with GitHub

This can happen if you have been working in a folder that is not the one within your Wordpress Studio/OneDrive folder. The key here is to relink GitHub with the folder that is in the proper location.

Specifically, GitHub's invisible files (used to manage the sync) must be in the theme folder you are working on.

  1. Backup the theme folder you have been working on (ie move it to desktop)
  2. Go to GitHub Desktop
  3. Click Add
  4. Choose "clone repository" from your GitHub account (first tab)
  5. Select your theme
  6. Clone it into /wp-content/themes/ inside the WP Studio folder inside OneDrive
  7. In GitHub Desktop, click "Open in Explorer" (macOS) or "Open in Explorer" (PC)
  8. Copy the files and folders in the backup from step 1
  9. Paste them into the window that opened in step 7
  10. Replace all files/folders
  11. Go back to GitHub Desktop
  12. Push

Is your Repo "Not Found"?

Did you submit your repo, but received a message from your teacher that the repo was "not found"?

You probably didn't uncheck the privacy box when you created the GitHub repository.

  1. Go to your GitHub repo's web page,
  2. Click Settings in the top menu bar, at right
  3. Scroll all the way down to the "Danger Zone"
  4. Edit the first option: Visibility
  5. Make the repo Public.

"Could Not Connect to the Database" WordPress Error

Wordpress database connection error screen

When starting WordPress Studio, you may get an error message like the screen above. This means that WP Studio tried to read the database information but could not find or open the database file. When using OneDrive to sync the WP Studio installation folder across different machines, this error occurs when WordPress tries to access a file that OneDrive has moved to the cloud.

Solution

  1. Open WordPress Studio
  2. Click the "Open in Finder/Windows Explorer" button to open the web site's root folder. (For example: One Drive/Semester4/Web-IV/WP-Studio)
  3. Go up one level from "WP-Studio" to "Web-IV".
  4. Right-click on the root folder "WP-Studio"
  5. Set the One Drive settings to "Always keep on this device".

always keep on this device

About

Instructions for beginner Desktop users

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors