2022-4-13~14 git,github

11513 ワード

崔祐栄講師.
blog: https://ulgoon.github.io/
github: https://github.com/ulgoon/
email: [email protected]
CLI ShellコマンドとVim editor
https://gitforwindows.org/ Gitインストール
Shell:オペレーティングシステムのカーネルとユーザーを接続するソフトウェア
カーネル:コンピュータ物理デバイスとアプリケーションの間でコマンドを渡すソフトウェア
bash:Brian Fox作成Unix Shell
ls -a : -다음 옵션들을 flag라고 한다.
~: 최상단 디렉토리

touch 파일명.확장명    파일생성
touch server.py && touch server.java
mv index.html src 파일이동
mv ../server.js ./
cp hello.md src 복사
cp hello.md ./hello-copy.md 현재폴더에 사본 만들기

rm -r src 디렉토리 삭제
rm -rf src
sudo: super user로 do해라. 권한이 필요한 일들. 관리자 권한으로 실행과 같은 의미
mv hello.md bye.md 파일명 변경
Vim:編集へんしゅう
vim learn-markdown.md
i insert모드
# How to use vim with markdown
This document is to learn markdown and vim together.

## Vim mode

- normal mode: press escape on any mode(esc)
- insert mode: press i on normal mode
- visual mode: press v on normal mode
- command mode: press : on normal mode
- commands: :w, :wq, :q, :q!

## Markdown systax
- hashtag(#): heading text <h1><h1>
- hyphen(-): Unordered list <ul><li></li></ul>
- numbers(1.): Ordered list <ol><li></li></ol>
- plain text: paragraph <p></p>
normal모드- shift+세미콜론 - :wq(저장하고 나가기), q!(저장하지 않고 나가기)
Git
git config--global user.name "lillly02v"
git config--global user.email "[email protected]"
git config --global core.editor "vim"
git config --global core.pager "cat"

https://ulgoon.github.io/2019/09/first-to-git/

깃허브 repository생성(readme.md 포함)-code주소 복사
git clone https://github.com/lillly02v/first-repo.git(shift+insert)
cd first-repo/ 레포지토리 이름
vi README.md = vim README.md

git remote    --> origin
git remote add tiger https://github.com/lillly02v/first-repo.git--remote別名の追加
git remote-v--アドレスに出力
git add 파일명 - git commit(-m 쓰지말기)

ctrl+c: 오류났을 경우 명령어실행 취소

git push origin main
https://www.conventionalcommits.org/ko/v1.0.0/
commit 제목은 commit을 설명하는 하나의 구나 절로 완성
Importance of Capitalize

prefix 꼭 달기
- feat: 기능 개발관련
- fix: 오류 개선 혹은 버그 패치(오타수정, 안되던걸 고침)
- docs: 문서화 작업(README.md)
- test: test 관련
- conf: 환경설정 관련(.gitignore)
- build: 빌드 관련
- ci: Continuous Integration 관련
- BREAKING CHANGE: Drop Support /api/v1
- refactor: Refactor user classes(효율성 수정, 코드품질개선)

settings-developer settings - personal access tokens - generate new token - no expiration - 다 체크 - generate token
- 로그인 풀리면 키값 붙여넣기

git add . 하지말기(파일명으로 하나하나 하기)

TIL : 매일 공부한 것 정리
디렉토리로 언어나 기술, 학문 구분
mkdir git-github
mkdir html-css
해당 배운 내용을 추가
touch git/220413-git-first.md
touch git/220414-git-cowork.md
(html도 가능)

오늘 한일, 내일 할 일
220417_TIL

```shell
$ git clone {repo url}
$ cd {repo}
$ git add README.md
$ git commit
$ git push origin main
```
羽センターブログのユーザー名を作成します.github.io
node -v
npm -v
window: nodejs.org에서 LTS설치

npm install -g hexo-cli
sudo  npm install -g hexo-cli(에러 떴을 경우. windows는 아님)
git bash 관리자 권한으로 실행
hexo하고 도움말이 뜨면 설치 성공한 것

6:02:05
hexo.io - Docs

$ hexo init blog(blog는 디렉토리명) - cd blog
-npm install-hexo generate-hexo server(방화벽 허용)-
localhost:4000(크롬)-ctrl+c
hexo new post "My first hexo blog"- 
vi source/_posts_Myfirst-hexo-blog.md

---
title: My first hexo blog
date: 2022-04-17 06:16:15
tags:
---
ㄴ지우지 말고 작업(enter대신 normal mode 에서 소문자o)
(title은 수정해도 됨)
-hexo clean && hexo generate
-hexo server-localhost:4000(크롬)
-깃허브-new 레포-lillly02v.github.io(레포이름)-주소복사
-vi _config.yml-author수정,title수정,
url:https://lillly02v.github.io-type:git
repo: github에서 복사한 주소 붙여넣기-branch: main
-theme: landscape
npm install hexo-deployer-git --save

테마설정
npm install hexo-theme-next --save
vi _config.yml  - theme: next
hexo clean && hexo generate-hexo server
ctrl+shift+r(새로고침)
hexo deploy

새글 쓸 때는 hexo new post 제목-그 파일 수정-
hexo server확인-hexo deploy(일주일 하나,두개, seo신경써서)-
lillly02v.github.io(크롬)
講師hexoに関するビデオhttps://asciinema.org/a/233626
22-4-14
クローン作成
README.md, MIT License -create-clone
.gitignore
touch .gitignore - vi .gitignore - 
# Custom

keyfile.pem
credentials/**   디렉토리안 모든 파일
secrets.*
*.java

- git status

gitigore.io-복사-붙여넣기
(clone하자마자 해야하는 일이 gitignore)
add-commit(conf:)
ブランチ機構
git branch - git branch print-hello
git switch print-hello - touch hello.py - vi hello.py
print('hello') - git add-commit

main브랜치 이동후 git merge print-hello
git branch -D print-hello   (브랜치 삭제)
おすすめPython!(テストコード用)
git branch repeat-hello
main에서 vi hello.py
magin_num = 3
if magic_num%3==0:
  print('hello')
  
git add-commit(브랜치를 넘나들때는 꼭 작업하던 파일 commit까지 완료한 후에 넘나들어야 함)

git switch repeat-hello
vi hello.py
for _ in range(1,10+1):
    print('hello')
    
git add-commit
git switch main
git merge repeat-hello(conflict 발생)
vi hello.py
for i in range(1,10+1):
    if i%3==0:
        print('hello')
        
git add-commit(conflict 해결방안 내용으로 적어주기)
git push origin main

깃허브-insights-network

git switch repeat-hello
git push -u origin repeat-hello(원격에 없던 브랜치 push할 때, 한번 -u해줘야함)
branching models: git flow, github flow, gitlab flow
独立Gitストリーム
https://danielkummer.github.io/git-flow-cheatsheet/index.ko_KR.html(Macのみインストール)
git switch main
git branch -D repeat-hello

git flow init (엔터 계속)
git flow feature start print-world(기능이름)
git branch (feature/print-world)
오타났을시 git branch -D feature/print-world
         git flow feature start print-world

vi hello.py - git add - commit
git flow feature finish print-world(develop 브랜치로 자동이동, 자동 merge)

git flow release start v0.1(relase name)
git branch(release/v0.1)
git flow release finish v0.1
3번째 commit은 develop가는 것 처리-:wq
git push -u origin develop
git switch main
git push origin main
git tag(태그 확인)
git push --tags
깃허브 tag-v0.1 클릭- release-create a new release-
choose a tag- auto-generate release notes-publish

다음 버전은 develop들어가서 feature start해서 feature finish하고 기능 쌓아서(feature반복) release start-release finish
アルゴリズム練習サイト:leetcode、HackerRank、Backson
Revert
git switch develop
git mv hello.py helloworld.py (rename)
git commit(fix:)
undoing
vi helloworld.py(수정)
git restore helloworld.py  (워킹 디렉토리(add하기전)에서 수정 복구-최신 commit상태로)
起動しない(リストアを追加)
vi helloworld.py(수정)
git add helloworld.py
git reset HEAD helloworld.py
gitコミットメッセージの変更
git add helloworld.py
git commit
git lg(상태 간략히 확인. git log보다)
git commit --amend
コミット解除(reset,revert)-リセットしないことを推奨
touch a.md
git add-commit
touch b.md
git add-commit
touch c.md
git add-commit
git revert --no-commit HEAD~3..(no commit: 마지막 한번에 commit)
git commit(내용으로 맨 밑에 반성문 쓰기. pull받아주시기 바랍니다.)
コラボレーション
<チーム長>
새로운 레포-fizzbuzz-readme,.gitignore python,mit-create-
cd Documents, cd dev - clone
cd fizzbuzz-with-u

git flow init(엔터계속)
git branch
touch fizzbuzz.py
git add fizzbuzz.py
git commit(feat:Create fizzbuzz.py)
git push -u origin develop

팀원에게 url전달(주소창)
<メンバー>
주소로 들어감-issues-new issue(내가 이런 일을 하겠다) title: do fizzbuzz with if, for
content: ## contents , ## Task list , -[] do fizz(checklist)-등록
-메인에서 fork-create fork-내 fizzbuzz 주소복사
-cd Document/dev-git clone(내 fizzbuzz)- 
cd fizzbuzz-git branch-git flow init-
git flow feature start do-fizzbuzz
-vi fizzbuzz.py(issues 보면서 작업 for i in range(1,16+1): print(i))
-git add fizzbuzz.py
-git commit(feat: Print numbers with for statemet
to check python environment)
-vi fizzbuzz.py(수정)
-git add-git commit
-수정,add,commit 반복
-git flow feature finish do-fizzbuzz
-git push -u origin develop
-compare &full request(깃허브, open pull request)-
develop에서 develop으로 가게
-제목: fizzbuzz with if, for done
내용: close #1
-create pull request초록버튼
(『組長』)
issues-assignees지정-labels지정
pull rquest(메뉴)-files changed-write-add review comment
finish your review-request changes-submit review
<メンバー>
No ploblem ^^-comment

vi fizzbuzz-수정-git add-git commit-
git push origin develop
vi fizzbuzz-수정-git add-git commit-
git push origin develop
<チーム長>
깃허브
-resolve(issues)
file changed(메뉴)-viwed-approve

merge pull request-confirm merge
-close issue
<その他のチームメンバー>
git remote -v
팀장 주소 복사
git remote add upstream 팀장주소

git pull upstream develop
<チーム長>
git pull origin develop

팀장은 나중에 완성이 되면 release