Git

git

낮햇볕 2022. 2. 15. 12:19

달러표시없을때
ctrl c 누르면 강제종료후 달러표시없다면 달러표시 띄우게됨 

 //브랜치 깃배쉬 html 폴더 파일안
/HTML (master)
$ git branch test

/HTML (master)
$ git checkout -b test
fatal: a branch named 'test' already exists

/HTML (master)
$ git checout test
git: 'checout' is not a git command. See 'git --help'.

The most similar command is
        checkout

/HTML (master)
$ git checkout test
Switched to branch 'test'

/HTML (test)
$ git add .

/HTML (test)
$ git commit -m '세번째 브런치에서 수정'
[test 8d813f7] 세번째 브런치에서 수정
 1 file changed, 1 insertion(+)
 create mode 100644 "\354\203\210\353\241\234\354\232\264\353\270\214\353\237\260\354\271\230\354\227\220\354\204\234\354\210\230\354\240\225.txt"

/HTML (test)
$ git log
commit 8d813f74a5ed5069219bef069ece142591e57907 (HEAD -> test)
Author: 이름 이메일
Date:   Tue Feb 15 10:17:11 2022 +0900

    세번째 브런치에서 수정

commit 093255cba03a887725d2506e8ea63a40e3e9ff12 (origin/master, master)
Author: 이름 이메일
Date:   Tue Feb 15 09:22:26 2022 +0900

    두번째 커밋

commit 215e8a34720ea602d116ec4269f3c2242204719b
Author: 이름 이메일
Date:   Tue Feb 15 09:21:13 2022 +0900

    첫번째 커밋

/HTML (test)
$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
두개가지가 합칠라면 marge필요

/HTML (master)
$ git checkout test
Switched to branch 'test'

/HTML (test)
$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

/HTML (master)
$ git checkout test
Switched to branch 'test'


/HTML (test)
$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.

/HTML (master)
$ git merge test
Updating 093255c..8d813f7
Fast-forward
 ...\260\354\271\230\354\227\220\354\204\234\354\210\230\354\240\225.txt" | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 "\354\203\210\353\241\234\354\232\264\353\270\214\353\237\260\354\271\230\354\227\220\354\204\234\354\210\230\354\240\225.txt"

/HTML (master)
$ git branch
* master
  test

//초기화 git init
인덱스추가 git add .
커밋 git commit -m'기록할내용'
git log 내용확인 폴더에 커밋을 남김

git remote add origin '주소' 영역지정 깃허브주소
git push -u origin master 만들어둔 오리지네 브랜치이름 적기 원격저장소에 저장

git branch 브랜치 이름    브랜치생성
git checkout 브랜치이름   브랜치이동
git branch                    내용확인

git merge 머지할브랜치이름      머지사용
 *항상 mater브랜치에서 에서 merge해야함!!!//





//브런치 깃배쉬 html폴더 안




-b 옵션더해달라 브랜치만들고 이동하라
git checkout test 이동가능 master가 test로 바뀜

//브런치 하기
 git branch test

 git checkout -b test

 git checkout test //mater인거 test로바꿔짐

 git add . //파일 추가하기 위해


 git commit -m '세번째 브런치에서 수정'  // 파일만들어줘야함

 git log //추가된거 넣어졌는지 봄

 git checkout master //test 인거 master로 바꿈

 git checkout test //master test로 바꿈

git merge test //master test 합쳐짐

git branch //두개나오는거 알수있음


하나의 파일에서 추가 해줬을 때 merge추가







//페이지 만들기


깃허브설정

GitHub Pages

Pages settings now has its own dedicated tab! Check it out here! 체크누르셈

GitHub Pages페이지에서
Source
Your GitHub Pages site is currently being built from the master branch. Learn more.
밑에브랜치 루트 지정하고 세이브하면 위에 주소가 나올것임

GitHub Pages의링크
 Your site is published at 주소
이거 눌르면 404 나오는 그 뒤에 (내가 작업했던 html 파일 레포지토리에서 눌러서) 맨뒤 경로  
HTMl5 누르고 암거나 ex 멀티미디어.html 누르면
 멀티미디어.html 경로 
가나오는 데 거기서 젤뒤에 HTMl5/HTML멀티미디어.html를 복사한걸 저위에 GitHub Pages페이지 의 페이지링크(404)나온거경로 맨뒤에 붙여넣으면 멀티미디어가 나옴






//인덱스추가 html 폴더안


/HTML (master)
$ git add .

/HTML (master)
$ git commit -m '인덱스 추가'
[master a0154dc] 인덱스 추가
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename HTMl5/intex.html => index.html (100%)

/HTML (master)
$ git push -u origin master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 338 bytes | 338.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To 깃허브주소
   f91de08..a0154dc  master -> master
branch 'master' set up to track 'origin/master'.


파일 만들어줘야함  
html 폴더안에 만들어주기 index.html
 git add .

 git commit -m '인덱스 추가'

 git push -u origin master






//css폴더에  index 추가


/css
$ git init
/css/.git/

/css (master)
$ git add .

/css (master)
$ git commit -m 'CSS 첫번째 커밋'
[master (root-commit) 757c934] CSS 첫번째 커밋
 48 files changed, 2122 insertions(+)
 create mode 100644 "css/CSS3\353\252\250\353\223\210\355\231\225\354\235\270.css"
 create mode 100644 "css/CSS\353\263\200\355\230\225.css"
 create mode 100644 "css/CSS\354\206\215\354\204\261\354\213\244\354\212\265.css"
 create mode 100644 "css/CSS\355\231\225\354\236\245.css"
 create mode 100644 css/boxmodel.css
 create mode 100644 css/colorbackground.css
 create mode 100644 "css/css\353\260\225\354\212\244\353\252\250\353\215\270\354\213\244\354\212\265.css"
 create mode 100644 css/float.css
 create mode 100644 css/floatlayout.css
 create mode 100644 css/linklist.css
 create mode 100644 css/mycss.css
 create mode 100644 css/notic.css
 create mode 100644 css/position.css
 create mode 100644 "css/positon\354\213\244\354\212\265.css"
 create mode 100644 "css/positon\354\213\244\354\212\2652.css"
 create mode 100644 css/tablesprite.css
 create mode 100644 css/textfont.css
 create mode 100644 "css/\343\204\264.css"
 create mode 100644 "css/\353\247\201\355\201\254\354\242\205\355\225\251\354\213\244\354\212\2651.css"
 create mode 100644 "css/\353\257\270\353\224\224\354\226\264\354\277\274\353\246\254.css"
 create mode 100644 "css/\354\204\240\355\203\235\354\236\220.css"
 create mode 100644 "css/\354\204\240\355\203\235\354\236\220\354\213\244\354\212\265.css"
 create mode 100644 "css/\355\224\214\353\240\211\354\212\244\352\267\270\353\246\254\353\223\234\354\213\244\354\212\265.css"
 create mode 100644 "css/\355\224\214\353\240\211\354\212\244\353\260\225\354\212\244\354\231\200\352\267\270\353\246\254\353\223\234.css"
 create mode 100644 "html/CSS3\353\252\250\353\223\210\355\231\225\354\235\270.html"
 create mode 100644 "html/CSS\352\270\260\353\263\270\354\206\215\354\204\261\355\231\225\354\235\270.html"
 create mode 100644 "html/CSS\353\263\200\355\230\225.html"
 create mode 100644 "html/CSS\355\231\225\354\236\245.html"
 create mode 100644 "html/css \354\206\215\354\204\261\354\213\244\354\212\265.html"
 create mode 100644 "html/css\353\260\225\354\212\244\353\252\250\353\215\270\354\213\244\354\212\265.html"
 create mode 100644 "html/css\354\234\204\354\271\230\354\206\215\354\204\261.html"
 create mode 100644 html/index.html
 create mode 100644 html/notic.html
 create mode 100644 "html/position\354\213\244\354\212\2652.html"
 create mode 100644 "html/\343\204\264.html"
 create mode 100644 "html/\353\247\201\355\201\254\354\242\205\355\225\251\354\213\244\354\212\2651.html"
 create mode 100644 "html/\353\257\270\353\224\224\354\226\264\354\277\274\353\246\254.html"
 create mode 100644 "html/\353\260\225\354\212\244\353\252\250\353\215\270.html"
 create mode 100644 "html/\354\204\240\355\203\235\354\236\220.html"
 create mode 100644 "html/\354\204\240\355\203\235\354\236\220\354\213\244\354\212\265.html"
 create mode 100644 "html/\355\224\214\353\240\211\354\212\244\352\267\270\353\246\254\353\223\234\354\213\244\354\212\265.html"
 create mode 100644 "html/\355\224\214\353\240\211\354\212\244\353\260\225\354\212\244\354\231\200\352\267\270\353\246\254\353\223\234.html"
 create mode 100644 "html/\355\224\214\353\241\234\355\212\270\354\206\215\354\204\261\353\240\210\354\235\264\354\225\204\354\233\203.html"
 create mode 100644 "html/\355\224\214\353\241\234\355\212\270\354\206\215\354\204\261\355\231\225\354\235\270.html"
 create mode 100644 img/1644538123938.png
 create mode 100644 img/cs.jpg
 create mode 100644 img/img1.png
 create mode 100644 img/pencil (1).png

/css (master)
$ git remote add origin 깃헙 주소

/css (master)
$ git push -u origin master
Enumerating objects: 53, done.
Counting objects: 100% (53/53), done.
Delta compression using up to 4 threads
Compressing objects: 100% (53/53), done.
Writing objects: 100% (53/53), 108.31 KiB | 12.03 MiB/s, done.
Total 53 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), done.
To 깃허브주소
 * [new branch]      master -> master
branch 'master' set up to track 'origin/master'.

/css (master)
$ git add .

/css (master)
$ git commit -m '두번째  커밋'
[master f538dde] 두번째  커밋
 1 file changed, 20 insertions(+)
 create mode 100644 index.html


/css (master)
$ git push -u origin master
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 611 bytes | 611.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To 깃허브주소
   757c934..f538dde  master -> master
branch 'master' set up to track 'origin/master'.


css index 파일 그안에 링크 먼저 만들고
css 폴더 안 git bash

git init

git add .

git commit -m '커밋이름'

git push -u origin master   git 주소는 css폴더에 추가하는것이기 때문에 위에 이미 레포지토리있어서 주소는 안적음