Skip to main content
shopping_basket Basket 0
Login

Remote Flying Fish Project Part 13: Get yourself a Git

lokit
0

In the first advanced chapter, do you remember that you’ve been provided with a GitHub link for Flutter example apps? If you are just starting to learn all these development framework and programming stuff, I suppose it’d be a bit hard for you. Hence, here comes this chapter to introduce you to the basic usage of git.

In a nutshell, Git is a versioning control toolkit, similar to Concurrent Versions System [CVS] and Apache Subversion (SVN). Among all, git is now the most popular one. 

Anyways, Git helps to take a snapshot of your work whenever you push a commit. Thus, the platforms for holding your projects, which we call repository, allow us to download (or we usually use the word clone) projects made by other authors. The diagram below illustrates a simple structure of the versioning control system.

version explanation

Assuming we are at v1.2, we integrated some features during the upgrade of v1.0 to v1.1 and started a trial of some other features. If ever in the future we need to adopt feature 1, or feature 1+2, or feature 1+3, we will still be able to access these unadopted source codes with the versioning control system.

In addition, in software development, we use do versioning following a rule like this:

versioning format

====================================================

Now let’s get to the installation of Git. A very simple thing to do.

  1. Go to https://git-scm.com/downloads and choose the suitable OS platform.
  2. Run the installer after download.
  3. Restart any command-line interface (CLI) if opened. You will then have the git command available in your CLI.

To test, input `git` and return. You should get the following output.

usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
These are common Git commands used in various situations:
start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one
......

Then, we go back to the repository mentioned in the previous section https://github.com/iampawan/FlutterExampleApps

downloading from GIT

Click `Clone or download` at the right, and you will get the URL https://github.com/iampawan/FlutterExampleApps.git

The .git ending implies itself a git repository. Hence, we can now do

git clone [place the URL here, as a parameter of git clone command]

and then the project will be downloaded to your local storage.

To check the path location that you're currently browsing using CLI, type pwd (for MacOS, a Linux command) or chdir (for Windows DOS)

You may visit this website to see more of the commands reference for MacOS(Linux system) <--> Windows

https://www.geeksforgeeks.org/linux-vs-windows-commands/

Moreover, Flutter is actually linked up with git. You can change (either upgrade/ downgrade) Flutter version by doing this:

$ cd [path of Flutter root folder]
$ git checkout [branch, tag or commit hash]
#for example git checkout v1.20.0

Browse the available Flutter version here: https://flutter.dev/docs/development/tools/sdk/releases?

To retrieve your Flutter root location, use which flutter, trim the /bin/flutter part at the end and that's it.

And you are now good to go for the next few chapters, that we will go into the coding part and you will be able to access the repository that contains the complete source code in the last chapter. Stay tuned.

Parts in this series

Downloads

lokit has not written a bio yet…

Recommended Articles

DesignSpark Electrical Logolinkedin