Skip to content

Commit

Permalink
adding vscode appendix
Browse files Browse the repository at this point in the history
  • Loading branch information
rlopez133 committed Dec 10, 2024
1 parent b82ac95 commit 4076498
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions content/modules/ROOT/pages/appendix-vscode-commit-push.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
= Appendix: Using VS Code or Terminal to Commit and Push Changes
:id: appendix-vscode-commit-push

This section provides instructions for committing and pushing changes to your
Gitea repository. You can follow the steps using either **Visual Studio Code**
or the **terminal**, depending on your preference.

== Steps for Committing and Pushing Changes

Follow the steps below to commit and push changes to your Gitea repository.
Choose the method that suits you best.

=== Using Visual Studio Code

1. **Open the Source Control Panel**:
- Click the **Source Control** icon in the Activity Bar.
*Shortcut:* `Ctrl+Shift+G` (Windows/Linux) or `Cmd+Shift+G` (Mac).

2. **Stage Your Changes**:
- Locate the files listed under **Changes**.
- Click the **+** icon next to each file to stage them, or click the **+** icon next to **Changes** to stage all files.

3. **Enter a Commit Message**:
- In the input box at the top of the Source Control panel, type a descriptive commit message, e.g.:
```
Add manage_vm_playbook.yml for VM management
```

4. **Commit the Changes**:
- Click the **✔** (checkmark) icon to commit the staged files.

5. **Push the Changes**:
- Click the **…** (ellipsis menu) in the Source Control panel and select **Push**.
*Alternative:* Use the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`) → Type `Git: Push` → Press Enter.

6. **Verify in Gitea**:
- Open your Gitea repository in a web browser and confirm that the changes appear.

=== Using the Terminal

1. **Stage Your Changes**:
- Run the following command to stage all modified files:
```bash
git add .
```

2. **Commit Your Changes**:
- Commit the staged files with a descriptive message:
```bash
git commit -m "Add manage_vm_playbook.yml for VM management"
```

3. **Push Your Changes**:
- Push the committed changes to the remote repository:
```bash
git push
```

4. **Verify in Gitea**:
- Open your Gitea repository in a web browser and confirm that the changes appear.

== Tips for Working with Git

1. **View Git Output in VS Code**:
- Open the output log for Git by selecting **View → Output**, then choose "Git" in the dropdown to debug issues.

2. **Resolve Merge Conflicts in VS Code**:
- If there are conflicts during a pull or push, VS Code will highlight them in the editor. Use the conflict resolution options (e.g., **Accept Current Change**, **Accept Incoming Change**) to resolve them.

3. **Use the Terminal for Advanced Git Commands**:
- You can perform advanced Git operations like rebasing, stash management, or inspecting the commit history:
```bash
git log --oneline
git rebase origin/main
git stash
```

== Conclusion

This appendix provides step-by-step instructions for using Visual Studio Code
or the terminal to commit and push changes to your Gitea repository. Use these
steps to ensure your work is safely stored in the remote repository, and refer
to this section as needed during the labs.

0 comments on commit 4076498

Please sign in to comment.