-
Notifications
You must be signed in to change notification settings - Fork 29
Adds guide on using Git in Positron #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
d7e85f7
35fdfab
6ce301b
e4c1af6
c424cab
0edb621
6bbc210
21800fd
6565637
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,4 +34,5 @@ GitHub Copilot | |
| Anthropic Claude | ||
| Anthropic Claude Sonnet | ||
| Google Gemini | ||
| AWS Bedrock | ||
| AWS Bedrock | ||
| Git | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| title: Git Version Control | ||
| --- | ||
|
|
||
| Git is a powerful version control system that helps you track changes to your code, collaborate with others, and maintain a history of your project. Positron provides built-in Git integration that works seamlessly with Git repositories, even if you are new to version control. | ||
|
|
||
| ## What is Git? | ||
|
|
||
| Git is a distributed version control system that tracks changes in your files over time. It allows you to: | ||
|
|
||
| - Keep a complete history of your project | ||
| - Work on different features simultaneously using branches | ||
| - Collaborate with others on the same codebase | ||
| - Revert to previous versions when needed | ||
| - Merge changes from different contributors | ||
|
|
||
| ## Getting started with Git | ||
|
|
||
| ### Set up Git in Positron | ||
|
|
||
| Before you can use Git in Positron, you need to have Git installed on your computer. If Git is not installed, the Source Control view will show instructions on how to install it. | ||
|
|
||
| **Learn more:** [Set up Git in VS Code](https://code.visualstudio.com/docs/sourcecontrol/intro-to-git#_set-up-git-in-vs-code) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It feels like we might be missing an analogous instruction or link for getting setup with GitHub. I'm thinking about storing Git credentials, such as a PAT or SSH. I.e. the stuff that's going to make the GitHub flows described below actually light up.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about linking out to these docs, too? |
||
|
|
||
| ### Open a Git repository | ||
|
|
||
| Positron provides a few ways to work with Git repositories: | ||
|
|
||
| - **Open Folder** to use an existing Git repository | ||
| - **New Folder** to create a new folder, with the option to initialize it as a Git repository | ||
| - **New from Git** to clone an existing Git repository from a remote source like GitHub | ||
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does Positron / VS Code offer a way to |
||
| These options are available from the Welcome screen when you first open Positron, or you can access them later through the Command Palette (<kbd>Cmd/Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>) by searching for *Workspaces: New Folder from Git...* or *Workspaces: New Folder from Template...*. | ||
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ::: callout-tip | ||
| If you are a more advanced Git user, consider installing the [GitLens extension](https://open-vsx.org/vscode/item?itemName=eamodio.gitlens) for extended Git capabilities in Positron. | ||
| ::: | ||
|
|
||
|
|
||
| ## Basic Git workflow | ||
|
|
||
| ### Staging and committing changes | ||
|
|
||
| The basic Git workflow involves making changes to your files, then staging and committing those changes: | ||
|
|
||
| 1. **Make changes** to your files in Positron | ||
| 2. **Stage changes** by selecting which files to include in your next commit | ||
| 3. **Commit changes** with a descriptive message about what you changed | ||
| 4. **Push changes** to share them with others | ||
|
||
|
|
||
| The Source Control view in Positron shows all your changed files and makes it easy to stage and commit changes with a few clicks. | ||
|
|
||
| **Learn more:** [Staging and committing code changes](https://code.visualstudio.com/docs/sourcecontrol/intro-to-git#_staging-and-committing-code-changes) | ||
|
|
||
| ### Syncing with Remote Repositories | ||
|
|
||
| Once you have committed changes locally, you can sync them with a remote repository (like GitHub): | ||
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - **Push** your local commits to the remote repository | ||
| - **Pull** changes from the remote repository to your local copy | ||
| - **Sync** to both push and pull changes at once | ||
|
|
||
| **Learn more:** [Pushing and pulling remote changes](https://code.visualstudio.com/docs/sourcecontrol/intro-to-git#_pushing-and-pulling-remote-changes) | ||
|
|
||
| ## Working with branches | ||
|
|
||
| Branches allow you to work on different features or experiments without affecting your main codebase: | ||
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - **Create branches** for new features or bug fixes | ||
| - **Switch between branches** to work on different parts of your project | ||
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - **Merge branches** to combine changes back into the main branch | ||
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - **Create pull requests** to propose and review changes before merging | ||
samclark2015 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| **Learn more:** [Using branches](https://code.visualstudio.com/docs/sourcecontrol/intro-to-git#_using-branches) | ||
|
|
||
| ## Handling merge conflicts | ||
|
|
||
| Merge conflicts occur when Git cannot automatically combine changes from different branches. When this happens, Positron displays conflicted files in the Source Control view with a warning icon. | ||
|
|
||
| Positron provides a 3-way merge editor to help you resolve conflicts by choosing which changes to accept. You can also resolve conflicts manually by editing the file directly and removing the conflict markers. | ||
|
|
||
| **Learn more:** [Merge conflicts in VS Code](https://code.visualstudio.com/docs/sourcecontrol/overview#_merge-conflicts) | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| - [Complete VS Code Git Introduction](https://code.visualstudio.com/docs/sourcecontrol/intro-to-git) - Comprehensive guide with screenshots and examples | ||
| - [Git Official Documentation](https://git-scm.com/doc) - Official Git documentation | ||
| - [GitHub Guides](https://guides.github.com/) - Learn GitHub-specific features | ||
| - [Interactive Git Tutorial](https://learngitbranching.js.org/) - Visual and interactive way to learn Git | ||
| - [R-focused Git Guide](https://happygitwithr.com/) - A guide for R users to learn Git and GitHub | ||
Uh oh!
There was an error while loading. Please reload this page.