Learnable Assignment
Tutor: Charles Best
GIT AND VERSION CONTROL
Version control also known as source control is the practice of tracking and managing changes to file.
An example is Git. Git is a popular version control system used for tracking code changes, tracking who made the changes and coding collaboration.
The official website of Git is https://git-scm.com/downloads
Github
This is a code hosting platform for version control and collaboration. Others can work and create projects together from anywhere.
Working with Git and Github
Firstly is installation after download and run the command git — -version on your terminal to check for the version of git installed.
Get Favour Ezekwu’s stories in your inbox
Join Medium for free to get updates from this writer.
Run the code snippet git config — -global user.name “username” and git config — -global user.email “useremail” to register. To check if this code works run git — -global — -list, it should display the username and email.
To initialize git in a folder, open the folder using any code environment eg vs code. Click on new terminal and run git — -init // git status command shows the status of the git at every point in time.
Git branching allow different copies of the code to be worked on and are independent of each other
Master branch: this is the default branch. For every file that is on the git repository is of two states tracked and untracked files. Tracked files are files that git monitor the changes that occurs in them while untracked files are files that git doesn’t monitor the changes that occurs in them. To track an on tracked files run the git add filename and then git status
Use git add . to stage multiple files
The git commit is used to keep track of our progress: git commit –m “initial commit”
To create a new branch: git branch newname
To move to the branch: git checkout nameOfBranch
One can also push to an existing repository from the command line using: git remote add origin “then add the link to your github file” // git branch –M main => which automatically renames branch from master to main // git push –u origin main.
To show the remote link available: git remote -ve






