0% found this document useful (0 votes)
6 views135 pages

Chapter3 241107 213216

IOT CHAPTER 3

Uploaded by

Chetan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views135 pages

Chapter3 241107 213216

IOT CHAPTER 3

Uploaded by

Chetan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 135

Chapter Description

1.1. About Version Control UNIT 01

'Version control' is the one of the essential skills in software engineering


since all software source codes and applications have been constantly developed.

V1 V2
Master Release
branch
Branch Merge
out in

Develop
and test
1.1. About Version Control UNIT 01
1.1. About Version Control UNIT 01

v
1.2. Types of Version Control UNIT 01

Local Computer

Checkout Version Database

File Version 3

Version 2

Version 1
1.2. Types of Version Control UNIT 01

Computer A Central VCS Server

File
Version Database

Version 3

Version 2
Computer B
Version 1
File

Centralized Version Control Systems


1.2. Types of Version Control UNIT 01

Server Computer

Version Database
Version 3

Version 2

Version 1

Computer A Computer B
File File

Version Database Version Database


Version 3 Version 3

Version 2 Version 2

Version 1 Version 1
1.3. Benefits of Version Control UNIT 01
1.3. Benefits of Version Control UNIT 01
2.1. Git Overview UNIT 02

• When developing software, it is difficult to manage the latest version of the source code among team
members. For this reason, configuration management tool was created to solve the problems of version
control that occurs frequently in a project.
• One of these configuration management tools is Git, which was developed by Linus Torvalds in 2005 as a
version control system for the Linux kernel project.

Git Logo & Linus Torvalds

v
2.1. Git Overview UNIT 02
2.2. Git & GitHub Installation UNIT 02
2.2. Git & GitHub Installation UNIT 02
2.2. Git & GitHub Installation UNIT 02
2.2. Git & GitHub Installation UNIT 02

Master
Main branch
(working environment that stores the final version)
2.2. Git & GitHub Installation UNIT 02

$ git config --global user.name “siciot”


$ git config --global user.email siciot.2021@gmail.com
2.2. Git & GitHub Installation UNIT 02

$ sudo apt-get update


$ sudo apt-get install git
2.2. Git & GitHub Installation UNIT 02

$ git --version
2.2. Git & GitHub Installation UNIT 02

$ git config --global user.name “siciot”


$ git config --global user.email siciot.2021@gmail.com
3.1. GitHub Overview UNIT 03
3.1. GitHub Overview UNIT 03

Version Control Collaboration & Backup


3.2. GitHub Terminologies UNIT 03

Open Repository Private Repository User PC

clone
pull request
commit
Remote push
Repository
fork Remote Local File
Repository pull Repository
3.2. GitHub Terminologies UNIT 03
3.2. GitHub Terminologies UNIT 03

$ git init

$ git config

Ex

$ git status
3.2. GitHub Terminologies UNIT 03

$ git help

$ git help init


3.2. GitHub Terminologies UNIT 03

$ git add

$ git commit -m “Message”

$ git branch {new branch name}

$ git checkout
3.2. GitHub Terminologies UNIT 03

$ git merge

$ git push

$ git pull

$ git clone

$ git init + git remote add origin { URL } + git pull origin
main
3.2. GitHub Terminologies UNIT 03

Working Staging .git directory


Directory Area (Repository)

Checkout the project


v
Stage Fixes

Commit

https://paransilverlight.tistory.com/242
3.2. GitHub Terminologies UNIT 03

Untracked Unmodified Modified Staged

Add the file

v
Edit the file
Stage the file

Remove the file

Commit
3.2. GitHub Terminologies UNIT 03
3.2. GitHub Terminologies UNIT 03
3.2. GitHub Terminologies UNIT 03
4.1. Simple GitHub Exercise UNIT
04
4.1. Simple GitHub Exercise UNIT
04

Create repository

Create repository
4.1. Simple GitHub Exercise UNIT
04

https://github.com/siciot/example.git
4.1. Simple GitHub Exercise UNIT
04

Help

Applications
4.1. Simple GitHub Exercise UNIT
04

Personal access tokens Generate a personal access token


4.1. Simple GitHub Exercise UNIT
04
4.1. Simple GitHub Exercise UNIT
04
4.1. Simple GitHub Exercise UNIT
04

New folder(N)

Open in Visual Studio(V)


4.1. Simple GitHub Exercise UNIT
04

$ git init

https://github.com/siciot/example.git
4.1. Simple GitHub Exercise UNIT
04
4.1. Simple GitHub Exercise UNIT
04

$ git push –u origin main

$ echo “# example” >> README.md

$ git init

$ git add README.md

$ git commit –m “first commit”

$ git branch –M main


4.1. Simple GitHub Exercise UNIT
04

siciot

$ git push –u origin main


4.1. Simple GitHub Exercise UNIT
04

README.md first commit


4.1. Simple GitHub Exercise UNIT
04

This text file will be pushed


4.1. Simple GitHub Exercise UNIT
04

$ git add *

$ git commit –m “test updated”

$ git push –u origin main


4.1. Simple GitHub Exercise UNIT
04

test.txt test updated


4.2. How to use GitHub when working alone UNIT
04
4.2. How to use GitHub when working alone UNIT
04

https://github.com/siciot/example.git
4.2. How to use GitHub when working alone UNIT
04

~$ git clone https://github.com/siciot/example1. git


4.2. How to use GitHub when working alone UNIT
04

example1
4.2. How to use GitHub when working alone UNIT
04
4.2. How to use GitHub when working alone UNIT
04

pycharm Install
4.2. How to use GitHub when working alone UNIT
04
4.2. How to use GitHub when working alone UNIT
04

Save All
4.2. How to use GitHub when working alone UNIT
04

git add *
git commit –m “edit test.txt”

git push origin main


4.2. How to use GitHub when working alone UNIT
04

test.txt

This text file will be edited!!!!


4.2. How to use GitHub when working alone UNIT
04

$ git init

$ git add *

$ git commit

$ git push
4.2. How to use GitHub when working alone UNIT
04

$ git clone
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04

Siciot/example1

C:\Users\dongh\GitHub\example1
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04

test
-This text file will be edited!!!!
4.3. How to use GitHub through GUI environment UNIT
04

Push origin
↑ Last fetched 6 minutes ago 1↑

Committed just now


Undo
Delete test.txt
Commit to main
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04

1 # example2
2
3 ## edited!

Commit changes
4.3. How to use GitHub through GUI environment UNIT
04

Fetch origin
Last fetched 8 minutes age
4.3. How to use GitHub through GUI environment UNIT
04

Push origin
↓ Last fetched just now 1↓
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04

7 Pull request to main branch

6 move to make practice.py branch

GitHub Repository local Repository local Repository


(example1) (main branch) (make practice.py branch)
2 make new
1 clone README.md branch 3 README.md
practice.py practice.py
README.md
practice.py is added (created and pushed in ‘make
8 practice.py branch’)
in main branch

5 There is only
README.md 4 move to main branch
(No practice.py)
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04

$ sudo apt install github-desktop

$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
$ sudo rm /var/lib/dpkg/lock*

# Package Update
$ sudo dpkg --configure -a
$ sudo apt update

# Retry Install
$ sudo apt install github-desktop
4.3. How to use GitHub through GUI environment UNIT
04
4.3. How to use GitHub through GUI environment UNIT
04

Sign in to GitHub.com
Authorize desktop
4.3. How to use GitHub through GUI environment UNIT
04

GitHub Desktop
4.3. How to use GitHub through GUI environment UNIT
04

siciot/example1

Clone siciot/example1
4.3. How to use GitHub through GUI environment UNIT
04

1
2 New branch

1
2

\home \siciot2021\Documents/GitHub\example1
4.3. How to use GitHub through GUI environment UNIT
04

Publish branch
make practice.py
4.3. How to use GitHub through GUI environment UNIT
04

1 File 1 example1
2 Open 2 New
3 Python File

3 example1

4 OK
4.3. How to use GitHub through GUI environment UNIT
04

practice

Add
4.3. How to use GitHub through GUI environment UNIT
04

2 Add Configuration…

1 +
1 for i in range(4): 2 Python
Print(“*” * (i+1))
4.3. How to use GitHub through GUI environment UNIT
04

1 practice.py

2 OK
4.3. How to use GitHub through GUI environment UNIT
04

1 Script Path
console result

2 OK 3 Apply
4.3. How to use GitHub through GUI environment UNIT
04

$ cd {local path}
$ ls

practice.py README.md

practice.py
4.3. How to use GitHub through GUI environment UNIT
04

Push origin

1 Make practice.py

2 Commit to make-practice.py
Committed just now
make practice.py
4.3. How to use GitHub through GUI environment UNIT
04

$ ls

1 Current branch

2 main branch
4.3. How to use GitHub through GUI environment UNIT
04

GitHub Repository local Repository local Repository


(example1) (main branch) (make practice.py branch)
2 make new
1 clone branch 3 README.md
practice.py
README.md README.md
(created and pushed in ‘make
practice.py branch’)

5 There is only
README.md 4 move to main branch
(No practice.py)
4.3. How to use GitHub through GUI environment UNIT
04

GitHub Repository local Repository local Repository


(example1) (main branch) (make practice.py branch)
2 make new
1 clone branch 3 README.md
practice.py
README.md README.md
(created and pushed in ‘make
practice.py branch’)

5 There is only
README.md 4 move to main branch
(No practice.py)
4.3. How to use GitHub through GUI environment UNIT
04

1 Current branch

2 Recent branches

Switch branch
4.3. How to use GitHub through GUI environment UNIT
04

Create Pull Request

Create pull request


4.3. How to use GitHub through GUI environment UNIT
04

Continuous integration has


not been set up

Confirm merge
4.3. How to use GitHub through GUI environment UNIT
04

Merged

Delete branch
4.3. How to use GitHub through GUI environment UNIT
04

View stash
4.3. How to use GitHub through GUI environment UNIT
04

Delete

Discard
4.3. How to use GitHub through GUI environment UNIT
04

$ ls

$ cat practice.py
4.3. How to use GitHub through GUI environment UNIT
04

7 Pull request to main branch

6 move to make practice.py branch

GitHub Repository local Repository local Repository


(example1) (main branch) (make practice.py branch)
2 make new
1 clone README.md branch 3 README.md
practice.py practice.py
README.md
practice.py is added (created and pushed in ‘make
8 practice.py branch’)
in main branch

5 There is only
README.md 4 move to main branch
(No practice.py)
5.1. Simple Practice UNIT 05
5.1. Simple Practice UNIT 05

5 Now, Peter can push to Daniel’s

Daniel’s GitHub Repository Peter’s local Repository


(mini_project)
1 clone

main.py 4 Daniel give access to 2 main.py (edited)


Peter (Collaborator)

3 try to push but Peter can’t


5.1. Simple Practice UNIT 05

Create repository
5.1. Simple Practice UNIT 05

1 File

2 Clone repository

Clone
5.1. Simple Practice UNIT 05

1 File

2 Open

1 Local path

2 OK
5.1. Simple Practice UNIT 05

1 mini_project
2 New
Python
3
File
5.1. Simple Practice UNIT 05

Main.py

Commit to main
5.1. Simple Practice UNIT 05
5.1. Simple Practice UNIT 05

1 File

2 Clone repository
5.1. Simple Practice UNIT 05

1 File

2 Open
5.1. Simple Practice UNIT 05

main.py

1 mini_project

2 OK
5.1. Simple Practice UNIT 05

$ python3 main.py 4 1
5.1. Simple Practice UNIT 05

Push origin
5.1. Simple Practice UNIT 05

First Approach
‣ The first way is to give Peter permission on this Repository. When Daniel designates Peter as a Collaborator,
Peter is free to push to this Repository. As is is free, this method requires more mutual discussion and
management.
5.1. Simple Practice UNIT 05

Second Approach
5.1. Simple Practice UNIT 05

1 Settings

2 Manage access

3 Invite a collaborator
5.1. Simple Practice UNIT 05
5.1. Simple Practice UNIT 05

Accept invitation

View invitation
5.1. Simple Practice UNIT 05

Push origin
5.1. Simple Practice UNIT 05
5.1. Simple Practice UNIT 05

5 Now, Peter can push to Daniel’s

Daniel’s GitHub Repository Peter’s local Repository


(mini_project)
1 clone

main.py 4 Daniel give access to 2 main.py (edited)


Peter (Collaborator)

3 try to push but Peter can’t

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy