Workspace GitService
How to work with local Git and GitHub without confusing the repository on your computer with the remote repository.
01Two repositories, two places
Local repository
It lives inside the project folder. It contains the working files and the hidden .git folder, where local history, commits and branches are stored.
It can be used without an Internet connection.
Remote repository
It is the shared copy of the history hosted on GitHub. It provides remote backup, collaboration, review and access from other computers.
GitHub does not replace the local repository: Git synchronizes both locations.
02Visual flow
03Essential operations
| Operation | What it does | Internet |
|---|---|---|
| Save file | Saves content on disk. | No |
| Commit | Records a version in the local repository. | No |
| Push | Sends local commits to GitHub. | Yes |
| Pull | Downloads commits from GitHub. | Yes |
| Clone | Creates a local repository from GitHub. | Yes, once |
| Branch | Creates a separate line of work. | No |
| Merge | Integrates one branch into another. | Not necessarily |
04Benefits for the user
History and recovery
Restore earlier versions and see what changed, when it changed and who made the change.
Safe collaboration
Each collaborator works on a local copy and publishes changes without directly overwriting someone else’s work.
Branches and review
Branches allow changes to be tested without affecting the stable version. Pull requests allow review before integration.
05GitService inside Workspace
GitService exposes operations from Workspace and keeps the separation between the local project and GitHub visible.
Local status
Shows modified, new or deleted files.
Local commit
Records a version with a descriptive message without publishing it yet.
Push and Pull
Push publishes local commits. Pull incorporates changes published by collaborators.
Clone, branches and history
These create a local copy, support separate lines of work and show available versions.
06Recommended workflow
1 · Prepare
Create or open the project in Workspace. Initialize Git or clone an existing repository.
2 · Work
Check the status, edit and save the files.
3 · Record
Create a commit describing the change and review the local history.
4 · Synchronize
Use push to publish. Before starting work with collaborators, use pull.
07Fundamental rule
A commit may exist only on the computer. A file downloaded from GitHub is not automatically synchronized. GitHub is the exchange point, not a shared folder that is modified directly.