Skip to content

Setting Up Your Git Environment

andy.rothwell edited this page Apr 5, 2019 · 10 revisions

When you created the vue project with Vue CLI, it initialized a Git repository for you.

Working with Git can be done from your command line program ConEmu, but you should also have downloaded the program SourceTree already.

Open SourceTree, and begin the process of adding your project by clicking "Add" near the top:

Then click "Browse" and find your project in your files:

After selecting your project folder, click "Add":

Whenever you make changes to any files in your project, SourceTree will tell you which files have changes in them.

When you have changes that you definitely want to keep, you first "stage" and then "commit" these changes. SourceTree makes this very easy. You can highlight a single file and click "Stage Selected". Or you can click "Stage All" and it will stage all changes in all files:

After your changes are staged, you click "commit" to make the changes part of an official commit of your project:

When you work on a project for a long time, you may create many "branches" of the project using git, and there may be a long history of commits of the different branches. SourceTree also helps to see these things. If you click to the "History" Workspace, you can see all of the previous commits listed:

You can use SourceTree to see all branches and switch between them:

You can also see info about a remote location that you can set your project to "push" the code to

In the next step, we will set up a remote repo in the website Github, which you will push your code to from your computer using Git and SourceTree.

Clone this wiki locally