Skip to content

2. Project management

Tasks of the week: This is my first time to go through all this commands and coding stuff So exciting to learn and try development website.

Version Control

Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.

Create a personal website and document our process

#Git

Git is the most commonly used version control system. the special features in Git Its track the changes you make to your files, so you will have your own record of what has been done.

What is The repository?

in the beginning, as I explain above Git is the distributed version control system to manage your projects or group project as you work with a team together.

there are important operations for Git like Repository, Push and Pull

The repository is where you put your documentation.

  • A local repository is a repository on your PC and they call it a local.

  • The global repository in GitLab is like a cloud system. they call it Remote.

So here if we type the command Push we upload the data from your local repo to the global repo.

Install Git for windows

1-Download the latest Git for Windows installer

2-When you’ve successfully started the installer, you should see the Git Setup Follow the Next and Finish prompts to complete the installation.

Click Run and the message will show up click Ok

you can use the git bash terminal to work with git, but here we will integrate with Cmder for better use of the command lines tool

#Cmder

There is no installation file for Cmder, just download the file, unzip it and run Cmder.exe.

  • Install the latest Version of Cymder

  • Extract the file then click cmder.exe


Cmder + git Bash

I already download the Git in the beginning Now I Set up Cmder to use bash by default first click cmder.exe the command line will show up you need to click the Green arrow >> click setup tasks >> Start

Now the new tasks will appeared git bash, click save and close this window.

✦✦ Now whenever you open Cmder will open a git bash terminal ✦✦


SETUP GIT (to do only the first time)

Start with creating an empty repo in one of the files on our local computer by Type this command

 > git init

then Add Git username and set your email

> git config –global user.name “weam.alghamdi”

then Configure you email address for uploading

> git config –global user.email “Wmgh94@gmail.com”

{I made mistake when I write the code as you see in the first time }

#SSH KEY

Now we should check if we have an SSH KEY already

cat ~/.ssh/id_rsa.pub

Git tutorial said (If you see a long string starting with ssh-rsa, you can skip the ssh-keygen step) for me I didn’t see it so I can’t skip it ^_^ )

Generate your SSH key by Type

ssh-keygen -t rsa -C “$your_email”

Now possess your SSH key pair and can upload the public key to the server and authentication using your private key.


Copy the SHH key

to copy the SSH keys Type in the command prompt

cat ~/.ssh/id_rsa.pub

Note

this command will show your keys in the command line, this key is private make sure to not give it to anyone

Open The Gitlab

Now open Gitlab and sign in ,click your profile picture and click preferences >> then SHH Key

Then past the SSH key that you copied before from the command prompt or from the .ssh folder

go to Windows(C): >> Users >> .ssh and the open the id_rsa.pub by notepad then copy all until you email then paste it in GitLab

and click add key, it should automatically detect the title as you write it before y

Create new project on gitlab

On the top bar, select Menu >> Project >> Create new project

You already created the SSH key you can create a new project from GitLab, in git lab you can either start with a new blank project or start with a template, here we are going to start a blank project

#Clone my website

Create a folder on your desktop

desktop > Fabacademy > website

then open your terminal Type $ Cd/ and copy the path of the folder you create

then Type $ git clone Copy the HTTPS for GitLab

then the new repo will directory create on your hard drive


Create a .gitlab-ci.yml file

To add the configuration file (.gitlab-ci.yml) to the root directory (master), there are many ways but for me I use:

Open your command prompt and type $Cd (drag and drop) then click Enter

then you will notice the root directory will change to your master

The gitlab-ci.yml file is a YAML file where you configure specific instructions for GitLab CI/CD. and in this file you can find The structure and order of jobs that you runner should execute and you find The decisions the runner should make when specific conditions are encountered.


BASIC GIT COMMANDS

The most command you will use each time if you want to push:

  • git add : This command adds all changes included in the next commit.

  • git commit –-m “add message” : This command adds a message to each push.

The ‘git commit’ is the command to record the changes that happen to a repository. These changes could be additions, deletions, or updates to the files stored in the repository.

The commit message is to describe the change so that in the future can see and understand the changes you have made or your team.

  • Git push : This command pushes all local files to GitLab.

The sequence would be to add files to the staging area, use commit to record the changes, then use ‘git push’ to send the progress to the remote repository.


#MkDocs

A static site generator is a tool that generates a full static HTML website based on raw data and a set of templates here I keep using MkDocs because I have zero experience in web development or the languages.

to be able to document on my computer I should install Mkdocs on it, so I can edit Markdown and see the final website parallels with my computer

Python

First we should install python as well.

To install go to python website ( https://www.python.org/downloads/ ) and then Select latest Version of Python

Run Executable Installer and click the Install Now, the process starts.

Verify Python by Open the command prompt then Type ‘python’ and press enter


  • Add Python installation path to %PATH%: following this steps :

1.Open control panel >> system and Security

2.Open the system environmental variables

3.Select PATH System variables, then Click Edit

4.Click New and add python path


Pip

Verify Pip by open the command prompt then type $ pip –Version >> $ pip install –upgraide to check if pip was installed.

MkDocs

After you have successfully installed python and pip on our Windows system You should now have the mkdocs command installed on your system.

Run mkdocs by type on command prompt $ pip install mkdocs to check that everything worked okay.

#Atom

the last step in out web builder it’s the text editor To install Atom go to Atom website ( https://flight-manual.atom.io/getting-started/sections/installing-atom/ ) Click the button and download the .exe file.

Run the .exe package and Atom get easily installed by itself on the Windows OS then by type on command prompt $ atom . its will open the atom program directly.

First pushed

Finally I Pushed my first picture from atom

I edit and add by using Atom and to push I’m using a command prompt by type

  • git add
  • git commit –-m “adding pic to about me”
  • Git push

You can also push by atom after you finish editing press Ctrl+S then press Stage all write the commit message then press commit to master and finally press push for me this way is more easy and practical way.

Compress and resize Image and videos

#Image Magick

Image Magick can resize, flip, mirror, rotate, distort, shear and transform images.

  • Pick the location that is closest to you, then download the latest version.

  • To convert video in command line you can check installing FFmpeg

  • Add it to %PATH%: following this steps :

1.Open control panel >> system and Security

2.Open the system environmental variables

3.Select PATH System variables, then Click Edit

4.Click New and add python path


  • Image magicks in command line

#FFMpeg

FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams.


  • Add it to %PATH%: following this steps :

1.Open control panel >> system and Security

2.Open the system environmental variables

3.Select PATH System variables, then Click Edit

4.Click New and add python path


  • ffmpeg in command line


Last update: August 17, 2022