Useful shortcuts for vi editor

Sunday, 13 September 2020

A basic git exercise

e.g. an example with basic git commands 
source: develop branch 
target: private branch (not exist on the git local/remote repository at the begin)

1st step:
$ git clone http://blabla --branch develop
-- cloning develop branch data on the local machine

2nd step:
git branch private
-- defining a new branch as "private" on the local repository

3rd step:
git checkout private
-- switching the active/using branch to "private" on the local repository

4th step:
make your changes on the files/folders

5th step:
git status
-- see the summary that what you changed on the local repository

6th step:
git diff
-- see the differences between local repo and remote repo

7th step:
$ git add --all
-- add all modified files from (local) working directory to git staging area

8th step:
$ git commit -m "my latest changes applied on the code"
-- save your changes to the local repository to be ready for git push

9th step:
$ git push --set-upstream origin private
-- push all changes to the (remote) git repository by defining a new remote branch as the same local branch name; origin private

That's all!

Difficulty level:
Low