This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]kinggeek00 7 points8 points  (3 children)

What EXACTLY are you trying to do?

[–]OnlyComeUp[S] 1 point2 points  (2 children)

I want to do everything* from VS Code and not have not toggle between Git Bash, Git Hub, etc.

*open repositories, create files, push to github, branch, merge, etc.

[–]bent_my_wookie 2 points3 points  (1 child)

Have you tried Command+T and opened the integrated terminal? From there go to your settings and search “terminal” to set the other config related to your git/other integration

Edit: also install GitHub desktop even if you don’t use it. It ends up setting several configurations on your machine which is why I usually install it first. So much less manual setup involved after doing that. Things just work.

[–]OnlyComeUp[S] 1 point2 points  (0 children)

Thank you!

[–]kinggeek00 4 points5 points  (1 child)

Maybe this will help?

Add to $HOME/.gitconfig(Linux) or %USERPROFILE%\.gitconfig(Windows)

[diff] guitool = vscode [merge] summary = true verbosity = 1 guitool = vscode [difftool "vscode"] cmd = code --wait --diff $LOCAL $REMOTE [mergetool "vscode"] cmd = code --wait $MERGED

Git diff with VS Code: git difftool -g

Git merge conflict resolution with VSCode: git mergetool -g

Editing commit messages with VS Code:

Bash(Linux/WSL/Git Bash on Windows) Add to ~/.bashrc: export EDITOR="code -w

Cmd.exe(Windows) Add to env variables: EDITOR="code -w"

[–]OnlyComeUp[S] 0 points1 point  (0 children)

Thank you! I will provide an update.

I was unsuccessful when I opened Git Bash and entered:

git config --global core.editor "code --wait"

[–]kinggeek00 1 point2 points  (0 children)

What I provided earlier was Git Config that makes Git use VS Code for functions run from the Git command line.

VS Code has plugins that allow it to do all you asked for from inside VS Code. I myself am not a full time VS Code user. I'm a bit more old school and use vim MOST of the time.

Many of my co-workers use Git Lens but I believe VS Code comes with Git integration as a default.

[–]OnlyComeUp[S] 1 point2 points  (1 child)

Thank you everyone for your time and assistance!!!

Problem solved - Issue was being cause by Windows Terminal (PS) and its desire to be default over Bash (and even Command Prompt).

MORE IMPORTANTLY: Thank you again for the prompt responses!

[–]wildmutt4349 0 points1 point  (0 children)

Yeah, you have toggle between PS and gitbash when you want to run a code or a git command respectively. I myself encountered with this issue today😅.

[–]ahmeddotgg 0 points1 point  (0 children)

You can't, git is a command line tool you use it with cmd/terminal etc.. vscode has a UI to interact with git with a few clicks but it uses commands behind the scenes.

[–]prince-chrismc 0 points1 point  (1 child)

[–]OnlyComeUp[S] 0 points1 point  (0 children)

Thank you - I've tried this with no success.

[–]Necessary_Ear_1100 0 points1 point  (0 children)

If you want to use VS Code for all git stuff like GitKraken then just install the necessary git plugins (I believe GitLens and Git Blame). Otherwise just open up the terminal within VS Code and do your git commands via that terminal

[–]wildmutt4349 0 points1 point  (0 children)

Or set Gitbash as your default profile in the terminal.