![]() Type in a "Commit message" in the big text area up top. The files in your repository folder will be listed at the bottom of the dialog. To do so, click the big "Commit" button in SourceTree's toolbar. (The bookmark is just a shortcut to the repository within SourceTree.) Click the "Create" button to create the repository.Īt this point, SourceTree has created an empty Git repository in our folder. The bookmark name will be pre-filled with the name of the folder you select. Enter the "Destination Path" to your Sublime Text project folder. The "Respostory Type" should be set to "Git". Click on the "Create New Repository" tab. The "Clone / Add / Create Repository" dialog will appear. ![]() toolbar button, or click File > Clone/New. This is a good option for users averse to the command line. SourceTree can create a new Git repository for you within the safe confines of its graphical user interface. If you have existing files in your repository folder, commit them all with the following two commands: git add. git initĪt this point, you will have a blank Git repository stored in a ".git" subdirectory. For me, this is my " folder cd create the repository, type the following command and hit enter. In the command line console, change to the folder you want the repository in. Launch the command line by typing cmd.exe in the Start Menu's search box, or via the key command windows+r, and hitting enter. This is the only time I use the command line for Git. ![]() You can create your Git repository using either the command line or GUI.Īn easy way to create a Git repository is to use the command line. The reason for staging the files isn't important if you are not a programmer, but you should know why committing to a Git repository isn't a one-step process. Because all changes to a Git repository must be added to a "staging area" before they are committed, you must run "Git: Add" prior to running "Git: Commit" for the commit to work. The most important commands are "Git: Add", which stages the current file for committing, and "Git: Commit", which commits the staged files to the Git repository. This package will add all manner of Git commands to Sublime Text's Command Palette ( control+shift+p). Third, use Sublime Text's Package Manager to install the "Git" package. Step 1.3: Install the Git package in Sublime Text This tool is useful for grabbing text from prior versions of your files. It will show you your repository (which, for us, will be a directory full of text files), a graph of the revision history (or "commit" history) of that repository (which, for us, will be a straight line with a node for each revision), the files changed in each commit, and the diffs between the various revisions ("commits") of each file. SourceTree is a free GUI front-end to Git. You will be using these tools in the later steps. This will install a suite of Git tools, primarily command-line tools, on your system. Step 1: Install Git tools on Windows Step 1.1: Install Git for Windowsįirst, download and install Git for Windows. ![]() If you want to jump into using Git for version control, here is how to do it. Stop here and just use Local History and/or Dropbox if you do not need or want to use Git for your plaintext files. I prefer Git because I use it for source code as well and appreciate its power, and its ability to push changes to a repository on a remote server for backup. Warning: Using Git for version control of plaintext files may be a little over-ambitious and unnecessary if you are already using Dropbox and/or Local History. It is also pretty simple to use, if, as in our case, we are just using a handful of its features. Git is small, fast, reliable, and has dozens of software tools and web sites supporting it. It was initially designed and developed by Linux Torvalds to use for the Linux kernel source code, so you know it has an amazing pedigree. If you are a programmer, you should already be aware that Git is a free and open source distributed version control system. To me, Git is the ultimate version control tool for plaintext files. Set up Git for version control of plaintext notes and drafts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |