Appendix: Using VS Code or Terminal to Commit and Push Changes
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
-
Right click to create the file under the tasks directory of your
vm_management
collection -
Make the appropriate changes to your file and VSCode Editor will auto-save.
-
Open the Source Control Panel:
-
Stage Your Changes:
-
Enter a Commit Message:
-
In the input box at the top of the Source Control panel, type a descriptive commit message, e.g.:
Add changes to main.yml
-
-
Commit the Changes:
-
Push the Changes:
-
Click the Sync Changes button to push the changes to your Gitea repository.
-
-
Verify in Gitea:
-
Open your Gitea repository https://gitea.apps.cluster-guid.dynamic.redhatworkshops.io/user1/virt-aap-day2/src/branch/rh1-2025 in a web browser and confirm that the changes appear.
-
Using the Terminal
-
Git clone the gitea repository:
git clone -b rh1-2025 https://gitea.apps.cluster-guid.dynamic.redhatworkshops.io/user1/virt-aap-day2
-
Switch to the directory:
cd /path/to/virt-app-day2
-
Make changes to file and save it:
vi /path/to/tasks/main.yml
-
Stage Your Changes:
-
Run the following command to stage all modified files:
git add -u
-
-
Set your Git identity:
-
Run the following command only once:
git config --global user.email "user1@redhatworkshops.io" git config --global user.name "User1"
-
-
Commit Your Changes:
-
Commit the staged files with a descriptive message:
git commit -m "Add changes to main.yml"
-
-
Push Your Changes:
-
Push the committed changes to the remote repository
-
You will be asked for user user1 and password password.
git push
-
-
Verify in Gitea:
-
Open your Gitea repository https://gitea.apps.cluster-guid.dynamic.redhatworkshops.io/user1/virt-aap-day2/src/branch/rh1-2025 in a web browser and confirm that the changes appear.
-