Use Git In Visual Studio Code



Use Git In Visual Studio CodeVisual studio code and gitUseUse Git In Visual Studio CodeVisual
  • Last week we released version 16.6 Preview 2 of Visual Studio 2019. It contained the first iteration of a revamped Git experience to improve your productivity when working with code on GitHub, Azure Repos, and other hosting services. You can learn more about how to use the entire Git feature set in Visual Studio in our new documentation.
  • Visual Studio Code, installed A basic understanding of Git concepts and commands, such as working with repositories, forks, clones, and branches, staging and unstaging changes, and pushing commits. You need a GitHub account.

In Visual Studio Code, you can open an integrated terminal, initially starting at the root of your workspace. This can be convenient as you don't have to switch windows or alter the state of an existing terminal to perform a quick command-line task. To open the terminal: Use the ⌃` (Windows, Linux Ctrl+`) keyboard shortcut with the backtick.

Visual Studio Code And Git

  • View and search git log along with the graph and details.
  • View a previous copy of the file.
  • View and search the history
    • View the history of one or all branches (git log)
    • View the history of a file
    • View the history of a line in a file (Git Blame).
    • View the history of an author
  • Compare:
    • Compare branches
    • Compare commits
    • Compare files across commits
  • Miscellaneous features:
    • Github avatars
    • Cherry-picking commits
    • Create Tag
    • Create Branch
    • Reset commit (soft and hard)
    • Reverting commits
    • Create branches from a commits
    • View commit information in a treeview (snapshot of all changes)
    • Merge and rebase

Open the file to view the history, and thenPress F1 and select/type 'Git: View History', 'Git: View File History' or 'Git: View Line History'.

Available Commands

  • View Git History (git log) (git.viewHistory)
  • View File History (git.viewFileHistory)
  • View Line History (git.viewLineHistory)

Keyboard Shortcuts

You can add keyboard short cuts for the above commands by following the directions on the website customization documentation.

NOTE: The file for which the history is to be viewed, must already be opened.

Source

Big thanks to ole

License





Comments are closed.