UCL-ARC / git-novice-vscode

Version Control with Git using VSCode
Other
0 stars 1 forks source link

Introducing to git #3

Open dpshelio opened 4 weeks ago

dpshelio commented 4 weeks ago

This is the only time that requires using the terminal, possible to use it from vscode. Check whether it works well from powershell, or needs to open a bash from vscode.

Set your user name and email

Open a terminal and type the following commands

git config --global user.name "<name>"
git config --global user.email "<email>"

git config --list will show you that the details you have entered are Ok.

dtwwwc1e commented 3 weeks ago

Yes, vscode works fine - configuring name and email, and then --list. powershell works fine too. If I understand it correctly, windows linux subsystem provides for powershell and vscode relies on that. But I might be wrong. Is git gui a viable possibility? but only available in bash. https://gitforwindows.org/

dpshelio commented 3 weeks ago

gitforwindows should also work in powershell. For this workshop, neither of WSL or bash would be required, as the commands above should be the same. We won't need to use git gui, as VSCode will work as our gui.

dtwwwc1e commented 3 weeks ago

I meant git gui has an edit form for the git config. No, we don't want two tools. 😃

dpshelio commented 3 weeks ago

Ooooh! if git gui has an edit form for the .gitconfig, then we may want to use that to do that step. I don't see how from its documentation.

dtwwwc1e commented 3 weeks ago

image As such

dtwwwc1e commented 3 weeks ago

Desktop@UCL Anywhere has vscode but not integrated with git (for windows). Should we request this extension?

dpshelio commented 3 weeks ago

Oooh cool! I see I can do it on Linux too. I had to, within a git repository, do:

git gui main

and then edit / options. Awesome! and it probably works on mac too. It doesn't have other parameters that we teach on a normal git lesson but these are normally set properly from the gitforwindows installation.

Desktop@UCL Anywhere has vscode but not integrated with git (for windows). Should we request this extension?

It's not an extension. I think the problem at D@UCL Anywhere is that these are "separated" apps and you need to set the settings such on vscode as:

Ctrl+shift+p and type "Open user settings json". Then insert this text between the provided { }.

    "Terminal.integrated.shell.windows": "C:\\ProgramData\\Microsoft\\AppV\\Client\\Integration\\6ABCFDEB-9F4A-4E27-8C85-33C10C448A7D\\Root\\VFS\\ProgramFilesX64\\Git\\bin\\bash.exe" ,
    "git.path": "C:\\ProgramData\\Microsoft\\AppV\\Client\\Integration\\6ABCFDEB-9F4A-4E27-8C85-33C10C448A7D\\Root\\VFS\\ProgramFilesX64\\Git\\cmd\\git.exe"

Though the path 6ABCFDEB-9F4A-4E27-8C85-33C10C448A7D may be different from time to time. I think it may depend on when they've updated git4windows.

To know the right path, you'll need to check where the git-bash application is installed, by browsing to it and clicking on the properties of the app.

dtwwwc1e commented 2 weeks ago

I like it git gui sneaked in to linux 🙂. It still means we got to go terminal and type git gui, can this be added to menu??

dpshelio commented 2 weeks ago

That's right! We still need to use the terminal to type that - we will never get rid of it, will we? Unless there's a vs code extension that does the same. Nevertheless, let's do this for now, as I believe that's less error prune than the whole git config... command. In the future, we could plan to look for a vs code extension (or create our own) that helps to set git config values.