GIT
What is GIT?
Important note;
You'll be familiar with services such as GitHub, or GitLab - these are not Git. These are simply services that offer git-compatible products.
------------------------------------------------------------------------------------------------------------------------------------------------
Installing GIT
apt install git
------------------------------------------------------------------------------------------------------------------------------------------------
GIT
------------------------------------------------------------------------------------------------------------------------------------------------
Setting GIT user details
git config --global user.email "[email protected]"
git config --global user.name "user.name"
Clone/download a GIT repository:
git clone https://github.com/xyz
Create a GIT repository:
(current working directory)
git init
Check repository status
git status
Push changes to be committed:
git add .
(. being all)
Commit changes:
git commit
-m "comment"
View git change logs
git log
------------------------------------------------------------------------------------------------------------------------------------------------
Branching
Branching is the term used to describe the usage of multiple Git repositories for development of a single software item.
As you can see above, there is a 'master branch' which would essentially be the release build. The other branches are used for developing and testing features and bug fixes. Once changes have been made, these are committed to the next branch, where they will again need to be committed to the live branch.
Show git branches:
git branch
Create a new branch:
git checkout -b branchname
Switch branch
git checkout branchname
Merge branches
git merge branchname
