20240809 Git ๊ธฐ์ด ๋ฐ ํ์ฉ ๊ฐ์ด๋
ย
ย
ย
ย
ย
1. Git ํ๋ก์ธ์ค ๊ฐ์
ย
2. Git ์ํคํ ์ฒ ๊ฐ์
ย
3. ์์ค ๊ฐ์ ธ์ค๊ธฐ : git clone
ย
ย
ย
์์ค๋ฅผ cloneํ๊ณ ํด๋น ๋๋ ํ ๋ฆฌ๋ก ์ด๋ํ๋ค.
git clone <์์ค URL> <๋๋ ํ ๋ฆฌ๋ช
>
cd <๋๋ ํ ๋ฆฌ๋ช
>
ย
ADO-git-handson# git clone https://zerobig-devops4demo@dev.azure.com/zerobig-devops4demo/202408_AzureDevOps_Git_Demo/_git/202408_AzureDevOps_Git_Demo 20240808_git_handson
Cloning into '20240808_git_handson'...
Password for 'https://zerobig-devops4demo@dev.azure.com':
warning: You appear to have cloned an empty repository.
ADO-git-handson# cd 20240808_git_handson/
ADO-git-handson# ls -rlht
total 0
ADO-git-handson#
ย
ย
4. git ๋ช ๋ น ๋ง๋ณด๊ธฐ : add/commit/push ์คํํ๊ธฐ
ํ์ผ์ ์์ฑํ๊ณ ์ปค๋ฐ ํ ๋ฆฌ๋ชจํธ๋ก ํธ์ํ๋ค.
vi README.md
git status
git add .
git commit -m "First Commit"
git status
git push
ย
ADO-git-handson# vi README.md
ADO-git-handson# git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
README.md
nothing added to commit but untracked files present (use "git add" to track)
ADO-git-handson# git add .
ADO-git-handson# git commit -m "First Commit"
[master (root-commit) 18c1fe6] First Commit
1 file changed, 1 insertion(+)
create mode 100644 README.md
ADO-git-handson# git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
nothing to commit, working tree clean
ADO-git-handson# git push
Password for 'https://zerobig-devops4demo@dev.azure.com':
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 235 bytes | 13.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (3/3) (9 ms)
remote: Validating commits... (1/1) done (0 ms)
remote: Storing packfile... done (68 ms)
remote: Storing index... done (44 ms)
To https://dev.azure.com/zerobig-devops4demo/202408_AzureDevOps_Git_Demo/_git/202408_AzureDevOps_Git_Demo
* [new branch] master -> master
ADO-git-handson#
ย
๋ฆฌ๋ชจํธ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์๋ก๊ณ ์นจํ์ฌ ํธ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ค.
Repos > Commits๋ฅผ ์ ํํ์ฌ ๋ด์ฉ์ ์ดํด๋ณธ๋ค.
๋ก์ปฌ์์ git log ๋ช ๋ น์ ํตํด commit์ ๋ํ ๋ก๊ทธ๋ฅผ ํ์ธํด๋ณธ๋ค.
git log
git log --oneline
ย
ADO-git-handson# git log
commit 18c1fe6382799469b6e433d6269021dddd77a760 (HEAD -> master, origin/master)
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 10:35:48 2024 +0900
First Commit
ADO-git-handson#
ADO-git-handson#
ADO-git-handson# git log --oneline
18c1fe6 (HEAD -> master, origin/master) First Commit
ADO-git-handson#
ย
ย
5. ์๋ก์ด ๋ธ๋์น ์์ฑํ์ฌ ์์ ํ๊ธฐ
ํ์ฌ ๋ธ๋์น๋ฅผ ํ์ธํ๊ณ ์๋ก์ด ๋ธ๋์น๋ฅผ ์์ฑํ์ฌ ์์ ์ ์ค๋นํ๋ค.
git branch
git checkout -b feat-1-colors
ย
ADO-git-handson# git branch
* master
ADO-git-handson# git checkout -b feat-1-colors
Switched to a new branch 'feat-1-colors'
ADO-git-handson# git branch
* feat-1-colors
master
ADO-git-handson# ls -rlht
total 0
-rwxrwxrwx 1 zerobig zerobig 21 Aug 8 10:35 README.md
ADO-git-handson# cat README.md
20240808_git_handson
ADO-git-handson#
ย
VS Code๋ฅผ ๋์์ colors.txt ํ์ผ์ ์์ฑํ๊ณ ๋ด์ฉ์ ์ ๋ ฅ ํ ์ ์ฅํ๋ค.
code .
ย
ADO-git-handson# git branch
* master
ํฐ๋ฏธ๋๋ก ๋์์ git status ๋ช ๋ น์ ์ํํ์ฌ ์ํ๋ฅผ ํ์ธํ๋ค.
git status
ย
ADO-git-handson# git status
On branch feat-1-colors
Untracked files:
(use "git add <file>..." to include in what will be committed)
colors.txt
nothing added to commit but untracked files present (use "git add" to track)
ADO-git-handson#
ย
๋ค์ ์ปค๋ฐ ํ ๋ฆฌ๋ชจํธ๋ก ํธ์ํ๋ค.
ADO-git-handson# git add .
ADO-git-handson# git staus
git: 'staus' is not a git command. See 'git --help'.
The most similar command is
status
ADO-git-handson# git status
On branch feat-1-colors
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: colors.txt
ADO-git-handson# git commit -m "Add colors.txt"
[feat-1-colors b5ecbfd] Add colors.txt
1 file changed, 3 insertions(+)
create mode 100644 colors.txt
ADO-git-handson# git status
On branch feat-1-colors
nothing to commit, working tree clean
ADO-git-handson# git push
fatal: The current branch feat-1-colors has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin feat-1-colors
ADO-git-handson# git push --set-upstream origin feat-1-colors
Password for 'https://zerobig-devops4demo@dev.azure.com':
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 294 bytes | 24.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (3/3) (6 ms)
remote: Validating commits... (1/1) done (0 ms)
remote: Storing packfile... done (36 ms)
remote: Storing index... done (45 ms)
To https://dev.azure.com/zerobig-devops4demo/202408_AzureDevOps_Git_Demo/_git/202408_AzureDevOps_Git_Demo
* [new branch] feat-1-colors -> feat-1-colors
Branch 'feat-1-colors' set up to track remote branch 'feat-1-colors' from 'origin'.
ADO-git-handson#
ย
๋ฆฌ๋ชจํธ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์๋ก๊ณ ์นจํ์ฌ ํธ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ค.
์๋ก์ด ๋ธ๋์น feat-1-colors
๋ฅผ ์ ํํ๊ณ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ค.
master ๋ธ๋์น์๋ ์กด์ฌํ์ง ์๋ colors.txt ํ์ผ์ด ์กด์ฌํจ์ ํ์ธํ ์ ์๋ค.
Repos > Commits๋ฅผ ์ ํํ์ฌ ๋ ๋ธ๋์น์ ๋ด์ฉ์ ๋น๊ตํ์ฌ์ฌ ์ดํด๋ณธ๋ค.
# master
# feat-1-colors
feat-1-colors ๋ธ๋์น์๋ colors.txt๊ฐ ์ถ๊ฐ๋์ด ์์ผ๋ฉฐ ํ๋์ ์ปค๋ฐ์ด ๋ ์๊ฒจ ์์์ ํ์ธํ ์ ์๋ค.
์ด๋ ๋ก์ปฌ์ ํฐ๋ฏธ๋์์๋ git log ๋ช ๋ น์ ํตํด ํ์ธํ ์ ์๋ค.
git log
git checkout master
git log
ย
ADO-git-handson# git log
commit b5ecbfdf8b941800654effe47efdb441bb54862e (HEAD -> feat-1-colors, origin/feat-1-colors)
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 11:12:21 2024 +0900
Add colors.txt
commit 18c1fe6382799469b6e433d6269021dddd77a760 (origin/master, master)
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 10:35:48 2024 +0900
First Commit
ADO-git-handson#
ADO-git-handson# git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
ADO-git-handson# git log
commit 18c1fe6382799469b6e433d6269021dddd77a760 (HEAD -> master, origin/master)
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 10:35:48 2024 +0900
First Commit
ADO-git-handson#
ย
HEAD ํฌ์ธํฐ
HEAD๋ ํ์ฌ ๋ธ๋์น๋ฅผ ๊ฐ๋ฆฌํค๋ ํฌ์ธํฐ์ด๋ฉฐ, ๋ธ๋์น๋ ๋ธ๋์น์ ๋ด๊ธด ์ปค๋ฐ ์ค ๊ฐ์ฅ ๋ง์ง๋ง ์ปค๋ฐ์ ๊ฐ๋ฆฌํจ๋ค. ์ง๊ธ์ HEAD๊ฐ ๊ฐ๋ฆฌํค๋ ์ปค๋ฐ์ ๋ฐ๋ก ๋ค์ ์ปค๋ฐ์ ๋ถ๋ชจ๊ฐ ๋๋ค. ๋จ์ํ๊ฒ ์๊ฐํ๋ฉด HEAD๋ *ํ์ฌ ๋ธ๋์น ๋ง์ง๋ง ์ปค๋ฐ์ ์ค๋ ์ท*์ด๋ค.
ย
ย
6. Pull Request ์ํํ๊ธฐ
ย
Azure Repo > Branches๋ก ์ด๋ํ์ฌ Create a pull request๋ฅผ ์ ํํ๋ค.
ย
์์ธํ ์์ฒญ ๋ด์ญ ์์ฑ, Reviewer ์ถ๊ฐ ํ Create๋ฅผ ํด๋ฆญํ๋ค.
Complete๋ฅผ ํด๋ฆญํ์ฌ master ๋ธ๋์น์ ๋ณํฉ์ ์ํํ๋ค.
Complete merge๋ฅผ ์ ํํ๋ค.
์ ์์ ์ผ๋ก ๋ณํฉ์ด ์ด๋ฃจ์ด์ก์์ ํ์ธํ๋ค.
Repos > Commits๋ฅผ ์ ํํ์ฌ ๋ ๋ธ๋์น์ ๋ด์ฉ์ ๋น๊ตํ์ฌ ์ดํด๋ณธ๋ค.
master ๋ธ๋์น์ Merged ์ปค๋ฐ์ด ์ถ๊ฐ๋์ด ์์ผ๋ฉฐ ์ปค๋ฐ ์ด๋ ฅ์ด ์ผ์นํ๊ณ ์์์ ํ์ธํ ์ ์๋ค.
# master
# feat-1-colors
์ด๋ ๋ก์ปฌ์ ํฐ๋ฏธ๋์์๋ git log ๋ช ๋ น์ ํตํด ํ์ธํ ์ ์๋ค.
git log
git log --oneline --graph
git checkout master
git log
git log --oneline --graph
ย
ADO-git-handson# git log
commit b5ecbfdf8b941800654effe47efdb441bb54862e (HEAD -> feat-1-colors, origin/feat-1-colors)
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 11:12:21 2024 +0900
Add colors.txt
commit 18c1fe6382799469b6e433d6269021dddd77a760
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 10:35:48 2024 +0900
First Commit
ADO-git-handson# git log --oneline --graph
* b5ecbfd (HEAD -> feat-1-colors, origin/feat-1-colors) Add colors.txt
* 18c1fe6 First Commit
ADO-git-handson#
ADO-git-handson# git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
ADO-git-handson# git log
commit 3e5344588a59bec19069ded7c22707e7fdb47bf3 (HEAD -> master, origin/master)
Merge: 18c1fe6 b5ecbfd
Author: ์๋ ๊น <zerobig.kim@gmail.com>
Date: Thu Aug 8 05:32:32 2024 +0000
Merged PR 57: Add colors.txt
Add colors.txt contains the lists of our colors we can provide
commit b5ecbfdf8b941800654effe47efdb441bb54862e (origin/feat-1-colors, feat-1-colors)
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 11:12:21 2024 +0900
Add colors.txt
commit 18c1fe6382799469b6e433d6269021dddd77a760
Author: Zerobig <zerobig.kim@gmail.com>
Date: Thu Aug 8 10:35:48 2024 +0900
First Commit
ADO-git-handson# git log --oneline --graph
* 3e53445 (HEAD -> master, origin/master) Merged PR 57: Add colors.txt
|\
| * b5ecbfd (origin/feat-1-colors, feat-1-colors) Add colors.txt
|/
* 18c1fe6 First Commit
ADO-git-handson# ls -rlht
total 0
-rwxrwxrwx 1 zerobig zerobig 21 Aug 8 10:35 README.md
-rwxrwxrwx 1 zerobig zerobig 14 Aug 8 14:55 colors.txt
ADO-git-handson# cat colors.txt
Red
Green
BlueADO-git-handson#
ย
# master
# feat-1-colors
ย
์ฐธ๊ณ
ํ์ฌ ์๋๋ฆฌ์ค์์๋ ๊ฐ๋จํ ํ๊ธฐ ์ํด์ ๋ณธ์ธ์ด ์ง์ Pull Request๋ฅผ ์์ฒญํ๊ณ ์ฒ๋ฆฌํ์ง๋ง ์ค์ ๋ก๋ ๊ถํ ์๋ ๊ฒํ ์๋ฅผ ์ง์ ํ๊ณ ํด๋น ๊ฒํ ์๋ฅผ ํตํด ์ฝ๋ ๊ฒํ ๋ฐ ํ์ธ์ ๋ฐ์์ผ ํ๋ค.
Pull Request๋ฅผ ์์ฒญํ๊ฒ ๋๋ฉด Reviewer์๊ฒ ์์ฒญ์ด ์ ๋ฌ๋๋ฉฐ ๋ค์๊ณผ ๊ฐ์ด Files ํญ์์ ๋ณ๊ฒฝ์ฌํญ์ ํ์ธํ๊ณ ๊ด๋ จ Comment๋ฅผ ๋จ๊ธธ ์ ์๋ค.
ย
ย
7. Brach ์ ๋ต ์๋ฆฝํ๊ธฐ
ย
Git ๋ธ๋์น ์ ๋ต ์ฑํ
ํ์ฌ master ๋ธ๋์น ๋ด์ ์ฝ๋๋ ์ฝ๊ฒ ์ ๊ทผํ์ฌ ์ฝ๋ ๋ณ๊ฒฝ์ ์ํํ ์ ์๋ ์ํ์ด๋ฏ๋ก ์ด์ ๋ํ ๋ณด์์ด ํ์ํ๋ค. ์์ โGit ๋ธ๋์น ์ ๋ตโ์ ๋ฐ์ดํธ ํ ์ ์๋ ๋ณด์์ ์ผ๋ก ์ทจ์ฝํ ์ํ์ด๋ค.
Git์ ๋ฒ์ ์ ์ด๋ฅผ ์ฌ์ฉํ์ฌ ์ฝ๋๋ฅผ ๊ณต์ ํ๊ณ ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ์ ์ฐํ๊ฒ ์ ๊ณตํ๋ฉฐ ํ์ ์ด๋ฌํ ์ ์ฐ์ฑ๊ณผ ์ผ๊ด๋ ๋ฐฉ์์ผ๋ก ์ฝ๋๋ฅผ ๊ณต๋ ์์ ํ๊ณ ๊ณต์ ํด์ผ ํ๋ ํ์์ฑ ์ฌ์ด์ ๊ท ํ์ ์ฐพ์์ผ ํ๋ค.
ํ ๊ตฌ์ฑ์์ ๋ค๋ฅธ ํ์๊ณผ ๊ณต์ ๋๋ Git ๋ธ๋์น๋ฅผ ํตํด ์ฝ๋ ๋ณ๊ฒฝ ์ฌํญํญ์ ๊ฒ์, ๊ณต์ , ๊ฒํ ๋ฐ ๋ฐ๋ณตํ๋ ์์ ์ ์ํํ๋ค. ์ด๋ฌํ ํ์ ์ํ ๋ธ๋์น ์ ๋ต์ ์ฑํํ๋ค. ๋ ํจ์จ์ ์ผ๋ก ํ์ ํ๊ณ ๋ฒ์ ์ ์ด์ ๋ํ ๊ด๋ฆฌ ์๊ฐ์ ์ค์ด๊ณ ์ฝ๋๋ฅผ ๊ฐ๋ฐํ๋ ๋ฐ ๋ ๋ง์ ์๊ฐ์ ํ ์ ํ ์ ์๋๋ก ํ๋ค.
๋ค์ ๋ธ๋์น ์ ๋ต์ Microsoft์์ Git์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๊ธฐ๋ฐ์ผ๋ก ํ๋ฉฐ ์์ธํ ๋ด์ฉ์ Microsoft์์ Git์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์ฐธ์กฐํ๋ค.
๋ธ๋์น ์ ๋ต์ ๋จ์ํ๊ฒ ์ ์งํ๋ค. ๋ค์ ์ธ ๊ฐ์ง ๊ฐ๋ ์ผ๋ก ์ ๋ต์ ๋น๋ํ๋ค.
์๋ก์ด ๋ชจ๋ ๊ธฐ๋ฅ๊ณผ ๋ฒ๊ทธ ์์ ์ feature ๋ธ๋์น๋ฅผ ์ฌ์ฉํ๋ค.
Pull Request๋ฅผ ์ฌ์ฉํ์ฌ feature ๋ธ๋์น๋ฅผ master ๋ธ๋์น์ ๋ณํฉํ๋ค.
๊ณ ํ์ง์ ์ต์ master ๋ธ๋์น๋ฅผ ์ ์งํ๋ค..
์ด๋ฌํ ๊ฐ๋ ์ ํ์ฅํ๊ณ ๋ชจ์์ ํผํ๋ ์ ๋ต์ ํตํด ํ์ ์ผ๊ด๋๊ณ ๋ฐ๋ฅด๊ธฐ ์ฌ์ด ๋ฒ์ ์ ์ด ์ํฌํ๋ก๋ฅผ ์ป์ ์ ์๋ค.
ย
ย
Git ๋ธ๋์น ์ ๋ต ๊ตฌ์ฑ
ย
Azure Repo > files๋ก ์ด๋ํ์ฌ master ๋ธ๋์น์์ colors.txt๋ฅผ ์ ํํ๊ณ Edit์ ์ ํํ๋ค.
Pink๋ฅผ ์ถ๊ฐํ๊ณ Commit์ ์ ํํ๋ค.
๋ค์ Commit์ ์ ํํ๋ค.
ํ์ผ์ด ์์ ๋๊ณ ํ๋์ Commit์ด ์์ฑ๋์๋ค.
์ด์ master ๋ธ๋์น๋ฅผ ๋ณดํธํ ์ ์๋๋ก ๊ตฌ์ฑ์ ํด๋ณด๊ฒ ๋ค.
Azure Repo > Branches๋ก ์ด๋ํ์ฌ master ๋ธ๋์น๋ฅผ ์ ํํ๊ณ ์ถ๊ฐ ์ต์์ branch policies๋ฅผ ์ ํํ๊ณ Edit์ ์ ํํ๋ค.
Branch Policies - Require a minimum number of reviewers๋ฅผ โ1โ๋ก ์ค์ ํ๊ณ ๋ฐ๋ชจ์ ํธ์์ฑ์ผ ์ํดํด Allow requestors to approve their own changes๋ฅผ ์ฒดํฌํ๋ค.
์ด์ ๋ค์ Azure Repo > files๋ก ์ด๋ํ์ฌ master ๋ธ๋์น์์ colors.txt๋ฅผ ์ ํํ๊ณ Edit์ ์ ํํ๋ค. ํ์ผ ๋ณ๊ฒฝ ํ Commit์ ์๋ํ๋ฉด โTF402455: Pushes to this branch are not permitted; you must use a pull request to update this branch.โ ์๋ฌ๊ฐ ๋ฐ์ํจ์ ํ์ธํ ์ ์๋ค. ์ฆ, ์ด ๋ธ๋์น์ ๋ํ ํธ์๋ ํ์ฉ๋์ง ์์์ผ๋ฉฐ ์ด ๋ธ๋์น์ ์ ๋ฐ์ดํธ๋ Pull Request๋ฅผ ํตํด์๋ง ๊ฐ๋ฅํจ์ ์ ์ ์๋ค.
์ด์ ๊ตฌ์ฑ๋ ํ๊ฒฝ์ ํ ๋๋ก ์ฝ๋ ๋ณ๊ฒฝ ๋ฐ Pull Request๋ฅผ ํตํ master ๋ธ๋์น๋ก์ ๋ณํฉ์ ์๋ํด ๋ณด๊ฒ ๋ค.
ย
ย
Git ๋ธ๋์น ์ ๋ต ๊ตฌ์ฑ ์ฆ
์์ค ํํํ
ํฐ๋ฏธ๋๋ก ์ด๋ํ์ฌ ๋ค์ ๋ช ๋ น์ ํตํด feature ๋ธ๋์น๋ก์ ์์ค๋ฅผ ํํํ ํ๋ค.
๋จผ์ ํ์ฌ ๋ธ๋์น๋ฅผ ํ์ธํ๊ณ ์๋ก์ด ๋ธ๋์น๋ฅผ ์์ฑํ์ฌ ์์ ์ ์ค๋นํ๋ค.
git branch
git checkout -b feat-1-colors
git fetch --dry-run
git pull origin master
cat colors.txt
git log --oneline --graph
ย
ADO-git-handson# cd 20240808_git_handson/
ADO-git-handson# git branch
feat-1-colors
* master
ADO-git-handson# git checkout feat-1-colors
Switched to branch 'feat-1-colors'
Your branch is up to date with 'origin/feat-1-colors'.
ADO-git-handson# git fetch --dry-run
Password for 'https://zerobig-devops4demo@dev.azure.com':
remote: Azure Repos
remote: Found 3 objects to send. (0 ms)
Unpacking objects: 100% (3/3), 295 bytes | 5.00 KiB/s, done.
From https://dev.azure.com/zerobig-devops4demo/202408_AzureDevOps_Git_Demo/_git/202408_AzureDevOps_Git_Demo
3e53445..28bab0f master -> origin/master
ADO-git-handson# git pull origin master
Password for 'https://zerobig-devops4demo@dev.azure.com':
From https://dev.azure.com/zerobig-devops4demo/202408_AzureDevOps_Git_Demo/_git/202408_AzureDevOps_Git_Demo
* branch master -> FETCH_HEAD
Updating b5ecbfd..28bab0f
Fast-forward
colors.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
ADO-git-handson# cat colors.txt
Red
Green
Blue
Pink
ADO-git-handson# git branch
* feat-1-colors
master
ADO-git-handson#
ADO-git-handson# git log --oneline --graph
* 28bab0f (HEAD -> feat-1-colors, origin/master) Updated colors.txt
* 3e53445 (master) Merged PR 57: Add colors.txt
|\
| * b5ecbfd (origin/feat-1-colors) Add colors.txt
|/
* 18c1fe6 First Commit
ADO-git-handson#
ย
์์ค ์์ ๋ฐ commit, push
colors.txt ํ์ผ์ ์ด์ด Yellow๋ฅผ ์ถ๊ฐํ๊ณ ์ ์ฅํ ํ git add, commit ๋ฐ push๋ฅผ ์ํํ๋ค.
vi colors.txt
git add .
git commit -m "Update colors.txt adding color 'Yello'"
git push
ย
ADO-git-handson# vi colors.txt
ADO-git-handson# cat colors.txt
Red
Green
Blue
Pink
Yellow
ADO-git-handson# git add .
ADO-git-handson# git status
On branch feat-1-colors
Your branch is ahead of 'origin/feat-1-colors' by 2 commits.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: colors.txt
ADO-git-handson# git commit -m "Update colors.txt adding color 'Yello'"
[feat-1-colors dc46381] Update colors.txt adding color 'Yello'
1 file changed, 2 insertions(+), 1 deletion(-)
ADO-git-handson# git push
Password for 'https://zerobig-devops4demo@dev.azure.com':
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 326 bytes | 21.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Analyzing objects... (3/3) (6 ms)
remote: Validating commits... (1/1) done (0 ms)
remote: Storing packfile... done (29 ms)
remote: Storing index... done (55 ms)
To https://dev.azure.com/zerobig-devops4demo/202408_AzureDevOps_Git_Demo/_git/202408_AzureDevOps_Git_Demo
b5ecbfd..dc46381 feat-1-colors -> feat-1-colors
ADO-git-handson#
ย
Pull Request ์์ฑ
๋ฆฌ๋ชจํธ ๋ฆฌํฌ์งํ ๋ฆฌ๋ฅผ ์๋ก๊ณ ์นจํ์ฌ ํธ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ๋ค.
Create a pull request๋ฅผ ์ ํ ํ Reviewers์ ์์ ์ ์ถ๊ฐํ๊ณ Pull Request๋ฅผ ์์ฑํ๋ค.
์ ์์ ์ผ๋ก master ๋ธ๋์น์ ๋ณํฉ์ด ์ด๋ฃจ์ด์ง ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ ์ ์๋ค.
์ฐธ๊ณ ๋ก Reviewers๋ฅผ ์ง์ ํ์ง ์์ผ๋ฉด ์ฌ์ ์ ๊ตฌ์ฑํ ๋ธ๋์น ์ ์ฑ ์ผ๋ก ์ธํด Pull Request ์์ฑ์ด ๋ถ๊ฐํจ์ ํ์ธํ ์ ์๋ค.
Pull Request ๊ฒํ ์๋ ๋ค์๊ณผ ๊ฐ์ด ์ฝ๋์ ๋ณ๊ฒฝ์ฌํญ์ ๋น๊ตํ ์๋ ์๊ณ ํ์ ์, ์๊ฒฌ์ ๋จ๊ธธ ์๋ ์๋ค.
Repos > Commits๋ฅผ ์ ํํ์ฌ ๋ ๋ธ๋์น์ ๋ด์ฉ์ ๋น๊ตํ์ฌ ์ดํด๋ณธ๋ค.
master ๋ธ๋์น์ Merged ์ปค๋ฐ์ด ์ถ๊ฐ๋์ด ์์ผ๋ฉฐ ์ปค๋ฐ ์ด๋ ฅ์ด ์ผ์นํ๊ณ ์์์ ํ์ธํ ์ ์๋ค.
# master
# feat-1-colors
ย