Differences Between VSCode and Jupyter Lab in Using Git | Dadosfera Documentation

In the Processing and Intelligence Module environment, you can use both VSCode (check it out here) and Jupyter Lab (which is native to the modules), but there are restrictions on using Git within VSCode.

What can you do in VSCode?

In VSCode, you can run local Git commands, meaning those that don't require a connection to the remote repository.

git log                 # View commit history
git status              # View status of changes
git add file-name       # Add files to staging
git checkout -b new-branch # Create and switch to a new branch

📌These commands work because they don't involve communication with the remote repository.

What does NOT work in VSCode?

Commands that require interaction with the remote repository (GitHub, GitLab, etc.) DO NOT WORK in VSCode.

Here are examples of commands that DO NOT work:

git pull origin main       # Pull changes from the remote repository
git commit -m "DOCS: This commit won't work in VSCode"  # Create a commit
git push origin my-branch  # Push changes to GitHub

Where to run remote commands (commit, pull, push)?

For commands involving the remote repository, use the Jupyter Lab terminal. Here are the commands:

git pull origin main # fetch updates from the main branch
git commit -m "Adding new feature"
git push origin my-new-branch # push new branch to the repository
📘

Summary

🔹 To view history, status, and add files, you can use VSCode.

🔹 To commit, pull, and push, use the Jupyter Lab terminal.

CommandWorks in VSCode?Works in Jupyter Lab?
git log✅ Yes✅ Yes
git status✅ Yes✅ Yes
git add nome-arquivo✅ Yes✅ Yes
git checkout -b branch✅ Yes✅ Yes
git commit -m "msg"❌ No✅ Yes
git pull❌ No✅ Yes
git push❌ No✅ Yes

💡 You also have the option to work exclusively in JupyterLab, if you prefer.

💡 But it's worth remembering that VSCode has thousands of Extensions that can be installed, adding a lot of value to the solution with VSCode.


Did this page help you?