Git branches, for instance, afford you the ability to have parallel versions of your project existing at the same time, and git merge provides you with tools to combine those versions when you decide one could benefit the other. And Git has plenty of great features to help you be creative and daring in the way you work, with the assurance that the known-good version of what you've done is safe. ![]() Git Cola can do all the typical Git actions and a few more. To pull all the latest commits from the server, navigate to the Actions menu and select Pull, or just press Ctrl+Shift+P. To keep your work environments in sync, you must regularly perform a git pull. If you're working with other people on a project, it's very likely that they'll commit files to the repository from their own computer. However, if you forget to add an important file to staging or to commit what's in staging, then you aren't pushing the data you think you're pushing. Git is designed to be an excellent workspace: You can have works-in-progress alongside old reliable files without worrying about the two negatively affecting one another. If a file has never been staged or hasn't been staged since you've made changes, then that data will not get pushed to the server. A git push sends only your committed files to the server. ![]() To push your commits to your remote repository, navigate to the Actions menu and select Push, or just press Ctrl+P. Once you have a remote configured, you can push your commits to the server. The URL is provided by your Git host and usually starts with (there are other protocols, such as and git://, but they have limitations, so they're rarely used). The name can be anything, but it's conventional (and therefore expected by most experienced users) for your primary remote to be named origin. In the dialog box that appears, enter a name for the remote and the URL. In the Edit Remotes window, click the plus ( +) symbol in the lower-left corner. To add a remote server, click on the File menu in Git Cola and select Edit Remotes. Once you've created an empty remote repository, you can add it to Git Cola. You can create a repository on a free Git host like GitLab and interface with it through Git Cola. It's common to use Git to collaborate with others, so it's very common for a Git repository to exist on a server accessible to others. Right now, your Git project exists only on your local machine. Right-click on the file and select Stage Selected. Once you have a file in your project directory, it's listed in the Status pane of Git Cola. It's just a way to keep track of what you have in progress. It's little more than a tag, and it's easily undone. Staging a file means that you've marked the file for inclusion in the next code commit. The first thing you typically do with a file in Git is stage it. ![]() This article focuses on text files because Git Cola doesn't natively support external Git extensions. For very diverse projects that involve lots of binary (non-text) data, there are tools like git-annex and Git-portal to enable you to benefit from Git without suffering from its aversion to large files. And just because Git is intended primarily for text, that doesn't mean you can't make an exception here and there. So is anything based in JSON or XML, such as the SVG graphics format, the PostScript (PS, the basis of PDF files) format, source code (PY, JAVA, and so on), and many more. Besides actual text files, there are many file formats that are based on raw text. For instance, HTML and CSS are pure text formats. Text formats are more prevalent than you may think. If you change a JPEG file in any way, you're essentially creating a brand new file because, while it's possible to generate the difference (a "diff" or "delta" in software terminology) between one version and the other, the amount of data required to represent that likely will be larger than both images combined. For instance, a JPEG image is actually a complex matrix of pixel values and positions passed through a compression algorithm. But there's a catch: not all file formats are suitable for version tracking. Technically, Git doesn't really care what kinds of files you add to your project. Git is primarily intended for use with text-based formats. Using your OS's file manager (Files on GNOME, Finder on macOS, Explorer on Windows), add some files to your project directory on your hard drive. It's up to you to populate your project with files, so for the moment, leave Git Cola behind.
0 Comments
Leave a Reply. |