mtak0235 / webserv

0 stars 0 forks source link

문제낸것 합치기 #24

Closed cseom closed 3 years ago

cseom commented 3 years ago

14, #21문제들을 합친다

soo-bak commented 3 years ago

Exercise 00 : My first repository

Turn-in directory : MyFirstRepository/

Files to turn in : InitRepository.sh


Initialized empty Git repository in /test/ex00/.git/
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        InitRepository.sh

nothing added to commit but untracked files present (use "git add" to track)


man git init
man git status




Exercise 01 : There is something hidden

Turn-in directory : MyFirstRepository/

Files to turn in : RemoveSomething.sh


Exercise 02 : Suit up !

Turn-in directory : ex02/

Files to turn in : ExamScore100.sh


user.email=yourIntraID@student.42Seoul.kr
user.email=yourIntraID


man git config --global




Exercise 03 : 3 match puzzle (x), 3 git-area puzzle (o)

Turn-in directory : ex03/

Files to turn in : WhatIsGoingOn.sh, a, b, c


On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        new file:   c

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   a
        deleted:    b

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        WhatIsGoingOn.sh

man git add
man git commit
man git push




Exercise 04 : Never mind!

Turn-in directory : ex04/

Files to turn in : a.c, b.cpp, c.json, YouCanGoWithUs.sh


No commits yet

Untracked files: (use "git add ..." to include in what will be committed) YouCanGoWithUs.sh a.c b.cpp

nothing added to commit but untracked files present (use "git add" to track)

<br>

> *man gitignore*

<br><br><br>

# Exercise 05 : Push

### Turn in directory : ex05/

### Files to turn in : push.sh

*** 

- 제출 폴더내에 push.sh라는 이름의 파일을 만드세요
- personnel access token generate 한후
- private 저장소를 만들고, 원격저장소에 git 폴더를 푸쉬하세요
- private 저장소를 만든뒤 code page에있는 `…or create a new repository on the command line`  아래의 명령어들을 push.sh에 입력하세요
- 동료에게 각의미에 대하여 설명할수있어야합니다.

정답

```bash
echo "# -" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/seko8976/-.git
git push -u origin main




Exercise 06 : Cancel1

Turn in directory : ex06/

Files to turn in : before.txt, after.txt


On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
    new file:   README.md
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    README.md

man git-rm




Exercise 07 : cancel2

Turn in directory : ex07/

Files to turn in : before.txt, after.txt


commit afa1ddb04637cca65c3b733e5995688e0ee302dd (HEAD -> master)
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:19:46 2021 +0900

    third commit

commit 96850db066d633873c8b0e0f4be1f867eeac2cd8
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:19:18 2021 +0900

    second commit

commit 19acd126d17379fca66c48c94c642eba8425eddd
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:10:46 2021 +0900

    first commit
commit 19acd126d17379fca66c48c94c642eba8425eddd (HEAD -> master)
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:10:46 2021 +0900

    first commit




Exercise 08 : cancel3

Turn in directory : ex08/

Files to turn in : before.txt, after.txt


commit 23b17583e2775cc7d022dda6d3c8de66ae09f548 (HEAD -> master, origin/master)
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:34:05 2021 +0900

    fourh commit

commit 8d39d9be4ddb9b43a04669bda1ae5d2bce602014
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:33:35 2021 +0900

    third commit

commit 3cc13430cfe5f95bb25d37afbedf17f5aa9e3c22
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:33:17 2021 +0900

    second commit

commit 8d12e5b81910a49c679eaeb14102cc4c07fd1225
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:32:40 2021 +0900

    first commit
    commit 3cc13430cfe5f95bb25d37afbedf17f5aa9e3c22 (HEAD -> master, origin/master)
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:33:17 2021 +0900

    second commit

commit 8d12e5b81910a49c679eaeb14102cc4c07fd1225
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:32:40 2021 +0900

    first commit

이 명령을 사용하면 자신의 local의 내용을 remote에 강제로 덮어쓰기를 하는 것이기 때문에 주의해야 한다.

되돌아간 commit 이후의 모든 commit 정보가 사라지기 때문에 주의해야 한다.

특히, 협업 프로젝트에서는 동기화 문제가 발생할 수 있으므로 팀원과 상의 후 진행하는 것이 좋다.




Exercise 09 : Change

Turn in directory : ex09/

Files to turn in : before.txt, after.txt


commit c7e614c3853eb191624e3ef7f6c079f4c8568c86 (HEAD -> master)
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:45:12 2021 +0900

    second commit

commit d31baa4694304523e2b8563e0373070ee65b29d0
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:44:47 2021 +0900

    first commit




Exercise 10 : Change2

Turn in directory : ex10/

Files to turn in : before.txt, after.txt


commit 8f0643d1c7460b3e1da1a9d799ab617b06960f88 (HEAD -> master)
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:49:23 2021 +0900

    sixth commit

commit 811e0593e1ea12ed84b8fa0c55f07c5ffaed602a
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:47:55 2021 +0900

    fifth commit

commit a2c87c9dc2ed8d1a2587240cd6c524368bd04e5c
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:47:42 2021 +0900

    fourth commit

commit 4344ee2abe943daf4bcaf7e27501d2aef09809b6
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:47:26 2021 +0900

    third commit
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:49:23 2021 +0900

    sixth commit

commit 86ce8137e6d897c4c926a0b611277dd8c2131e68
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:47:55 2021 +0900

    fifth commit

commit 6098ebae11e2d463a505dc130ee0a62fc9390421
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:47:42 2021 +0900

    fourth commit

commit ac7410537b619fa7d9e8eab074f2afe286dd4164
Author: seoko <seoko@goseogmin-ui-MacBookPro.local>
Date:   Tue Oct 26 20:47:26 2021 +0900

    change commit
soo-bak commented 3 years ago

Ex00

git init
git status




Ex01

rm -rf .git
git status




Ex02

git config --global user.email "yourIntraId@student.42seoul.kr"
git config --global user.name "yourIntraId"




Ex03

git add a b
git commit -m "#03 TODO: solve puzzle!"
git add c
rm b
echo a > a
git status




Ex04

echo .gitignore > .gitignore
echo c.json >> .gitignore
git status




Ex05

제출 폴더내에 push.sh 파일이 있는지 확인하세요

파일의 내용은 다음과 같아야합니다.

init 과 add commit branch remote push - u옵션의 의미를 아는지 확인하세요

echo "# -" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/seko8976/-.git
git push -u origin main

yes | no




Ex06

before.txt와 after.txt에 git status 에따른 상태가 알맞게 들어가 있는지 확인하세요

yes | no

git rm —cached 또는 git reset을 활용할줄아는지 물어보세요

yes | no




Ex07

before.txt와 after.txt에 알맞은 깃 로그가 들어갔는지 확인하세요

yes | no

git reset —soft 또는 git reset —mixed 또는 git reset 명령어를 활용하여 문제에 나온 깃로그를 만들었는지 확인하세요

yes | no

각옵션에대하여 git을 어떤상태로 되돌리는지 확인하세요. 이에대해 알고있는지 확인하세요

yes | no




Ex08

before.txt와 after.txt에 깃로그가 알맞게 들어가있는지 확인하세요

yes | no

git reset과 reflog옵션에 대하여 아는지 확인하세요

yes | no

강제로 푸시하는것에 대한 주의사항을 아는지 확인하세요

yes | no




Ex09

git commit —ammend 를 활용하여 commit 메시지를 잘바꾸었는지 확인하세요

yes | no




Ex10

before.txt와 after.txt에 알맞은 깃 로그가 들어갔는지 확인하세요

yes | no

git rebase -i HEAD~ 를 활용하여 예전의 커밋메시지를 바꾸는 방법에대하여 아는지 확인하세요

yes | no