PPL 2021 — Introduction to version control: Git

Gitlab, version control of git that is used in this course (Source: https://unsplash.com/photos/ZV_64LdGoao)
DVCS Illustration (Source: https://medium.com/faun/centralized-vs-distributed-version-control-systems-a135091299f0)
mkdir PPL201 # make PPL2021 folder
cd PPL2021 # change our directory to PPL2021
git init # initialize an empty git repository
Initialized empty Git repository in /home/fredypasaud/Documents/PPL2021/.git/
## Hello WorldThis is test for week 2 individual review.
Git Staging Area ( Source: https://dev.to/sublimegeek/git-staging-area-explained-like-im-five-1anh)
git add <filename> # to add one file
git add <filename1,filename2,....,filenameN) # if we want to add N ammount of files
git add . # to add all files on our working directory
git add README.md
git status
On branch masterNo commits yetChanges to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.md
git commit -m "<Commit Message>"
git commit -m "Initial Commit"
[master (root-commit) 28b33e8] Initial Commit
1 file changed, 2 insertions(+)
create mode 100644 README.md
git remote add <remotename> <gitlink>
git remote add origin git@github.com:fredypasaud/ppl2021.git
git push <remotename> <branchname>
git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 275 bytes | 275.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To github.com:fredypasaud/ppl2021.git
* [new branch] master -> master
Our development branch (noted by PBI-xxx) and Staging Branch
git checkout -b <your-new-branch-name>
git checkout <name-of-existing-branch>
git remote update
git pull remote <the-branch-name-you-want-to-pull>
Successful git pull command
Conflict detected when pulling
Using VScode, you can choose which change you want to apply to your code.
git merge <branch-name>
Rebase Illustration
# Create a feature branch based off of master 
git checkout -b feature_branch master
# Edit files
git commit -a -m “Adds new feature”
git rebase <base>

--

--

--

Under-graduated Students Majoring in Computer Science

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How you can automate Youtube to comment and Grow your channel (YouTube Comment Bot)

Why cloud is leading to a renaissance of IT infrastructure

Solend, hello world!

“Choose Flutter over Native Android Development” — for Beginners in 2020 ( Short and Conclusive)

Open API? Yes! Check that Box.

Amazon RDS Proxy makes it easier to use SQL in Serverless

The future of Mooncake

6 Tips To Write Better Software Documentation

Typewriter

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Fredy Pasaud

Fredy Pasaud

Under-graduated Students Majoring in Computer Science

More from Medium

Git (viewing the commit history)

how to create repository with multi folders in GitHub

Version Control using GIT

Introduction to GIT