Setup Github on Visual Studio Code
I usually access github from within Visual Studio Code. As such, when I start coding a new project, I often need a reminder, or a cheat sheet for how to connect Visual Studio Code to a Git repository. These notes are more for me than for anyone else, but I'm sharing them nonetheless.
Steps:
- Create a directory on the local file system.
- Create a repo on Github.
- Select Clone "Clone or download" on Github, copy the link
- In Visual Studio Code, sect File -> Add Folder to Workspace -> Select the newly created directory
- Select Terminal Window
- In the window, type:
git config --global user.name <github userID> git clone <URL from github link copied earlier>
That should be all that's required. any newly created file should be available on github after stage/commit/push.
Git configuration variables can be stored at three different levels. Each level overrides values at the previous level.
1. System level (applied to every user on the system and all their repositories)
- to view,
git config --list --system
(may needsudo
) - to set,
git config --system color.ui true
- to edit system config file,
git config --edit --system
- to view,
git config --list --global
- to set,
git config --global user.name xyz
- to edit global config file,
git config --edit --global
- to view,
git config --list --local
- to set,
git config --local core.ignorecase true
(--local
optional) - to edit repository config file,
git config --edit --local
(--local
optional)
Comentarios
Publicar un comentario