πŸ“
til
  • TIL(Today I Learned)
  • javascript
    • value-number-string-boolean-null-undefined
    • primitive-reference
    • Hoisting
    • Prototypes in Javascript
    • this
    • prototype
    • μ½œλ°±ν•¨μˆ˜ (Callback function)
    • ν•¨μˆ˜μ˜ 호좜
    • 자료ꡬ쑰 new keyword
    • closure
    • Promise
    • event-loop
    • array-object
    • 객체
    • Arguments
    • higher order function
    • operators-function-control-flow
    • 객체 생성 νŒ¨ν„΄ 3κ°€μ§€
    • Javascript scopes
    • Functional Programming
    • Design Patterns
    • 데이터 νƒ€μž…
    • Object 객체
    • ν‘œμ€€ λ‚΄μž₯ 객체의 ν™•μž₯
    • μ°Έμ‘°
    • ν•¨μˆ˜
    • 상속(Inheritance)
    • this - 'this'λ₯Ό μ‚¬μš©ν•˜λŠ” ν•΄λ‹Ή ν•¨μˆ˜λ₯Ό 'μ–΄λ–»κ²Œ' μ‹€ν–‰ν•˜λŠλƒμ— λ”°λ₯Έ 4κ°€μ§€ this μ •μ˜
    • 전역객체(Global object)
    • 객체 μ§€ν–₯ ν”„λ‘œκ·Έλž˜λ°
    • The 'new' keyword - Object Creation in JavaScript
  • javascript-api
    • Number
      • Number.MAX_VALUE
      • Number.isInteger
      • Number.NEGATIVE_INFINITY
      • Number.isNaN()
      • Number.POSITIVE_INFINITY
      • Number.parseFloat
      • Number.EPSILON
      • number.toExponential
      • Number.MAX_SAFE_INTEGER
      • Number1 - μžμ—°μˆ˜, μ •μˆ˜, 10μ§„μˆ˜, 2μ§„μˆ˜, λΆ€λ™μ†Œμˆ˜μ , μ‹€μˆ˜
      • Number.isSafeInteger()
      • Number.MIN_VALUE
      • Number.parseInt
      • Number.NaN
      • Number.isFinite()
      • Number.MIN_SAFE_INTEGER
      • toFixed
    • string.split
    • String.fromCodePoint
    • string.trimEnd
    • string.padStart
    • string.@@iterator
    • String.fromCharCode
    • string.toUpperCase
    • string.codePointAt
    • string.toLowerCase()
    • string.toString
    • string.includes
    • string.replace()
    • string.charAt
    • String.lastIndexOf
    • string.slice
    • string.search
    • string.padEnd
    • string.substring
    • string.length
    • string.trim
    • string.localeCompare
    • String.indexOf
    • string.endsWith
    • string.valueOf
    • String.raw
    • string.matchAll()
    • string.repeat
    • string.match
    • String.prototype
    • string.startsWith
    • string.charCodeAt
    • string.trimStart
    • string.concat
    • string.toLocaleUpperCase()
    • string.toLocaleLowerCase
    • String
  • learn-node
    • debugger
    • Tip
  • schema-design
    • Database Schema Design
    • Database Schema Design
  • react
    • LifeCycle
    • redux
    • Context API
    • ν•¨μˆ˜ν˜• μ»΄ν¬λ„ŒνŠΈμ™€ 클래슀, μ–΄λ–€ 차이가 μ‘΄μž¬ν• κΉŒ?
    • Hooksκ³Ό useEffect μ‚¬μš©ν•΄ 보기
    • Route
    • async wait μ‚¬μš©ν•˜κΈ°
    • Hooks API Reference
    • context
    • npm uninstall ν•˜λŠ”λ²•
    • test λ§Œλ“€κΈ°
  • tip
    • ν΄λ¦°μ½”λ“œ
    • BxSlider둜 ν…μŠ€νŠΈ 흐λ₯΄λŠ” 효과 λ§Œλ“€κΈ°
  • javascript30
    • Event Capture, Propagation, Bubbling and Once
    • Object and Arrays - Reference VS Copy
  • typescript
    • μš°μ•„ν•œ νƒ€μž…μŠ€ν¬λ¦½νŠΈ 2λΆ€
    • The Basic Cheatsheet
    • TypeScript
    • Type Guards and Differnetiating Types
    • μš°μ•„ν•œ νƒ€μž…μŠ€ν¬λ¦½νŠΈ
    • Generics
  • git-from-the-hell
    • git
    • init-status-add-commit-log-stage-repository
    • log-diff
    • λ¨Έμ§€ ν›„ branch μ‚­μ œν•˜κΈ°
    • μ§€μ˜₯μ—μ„œ 온 Git
    • reset-revert
    • develop branch λ₯Ό pull ν•˜κ³  μ‹Άμ„λ•Œ
  • conference-and-seminar
    • λͺ¨λ˜ ν”„λ‘ νŠΈμ—”λ“œ κ°œλ°œν™˜κ²½μ˜ 이해
  • fire-base
    • Firebase .gitignore
  • vanillacoding
    • Data Structures
    • Sorting Algorithms - part 1
    • Promise
    • class
    • 04.quiz
    • 07.event-loop
    • Design Patterns
    • OOP (Object Oriented Programming)
  • etc
    • μ•Œκ³ λ¦¬μ¦˜ μ½”λ“œλ¦¬λ·°
    • 슀슀둜 κ³΅λΆ€ν•˜λŠ” 법
    • 바닐라코딩 μˆ˜κ°• ν›„κΈ°
    • async 과제 ν›„κΈ° - 비동기, 동기, ν΄λ‘œμ €, λ°°μ—΄κ³Ό 객체
    • μœ μš©ν•œ μ‚¬μ΄νŠΈ
  • algorithm
    • The Supermarket Queue
    • Find the odd int
    • The Office III - Broken Photocopier
    • Directions Reduction
    • The Office II - Boredom Score
    • Divisible Sum Pairs
    • Codewars 이용자 μ†”λ£¨μ…˜ λͺ¨μŒ
    • Shortest Word
    • find key
    • Two Sum
    • Simple Pig Latin
  • Book
    • the essence of object-orientation
      • νƒ€μž…κ³Ό 좔상화
      • 객체 지도
      • μ΄μƒν•œ λ‚˜λΌμ˜ 객체
      • 좔상화 기법
      • 05. μ±…μž„κ³Ό λ©”μ‹œμ§€
      • 07.ν•¨κ»˜ λͺ¨μœΌκΈ°
      • 04. μ—­ν• , μ±…μž„, ν˜‘λ ₯
      • ν˜‘λ ₯ν•˜λŠ” κ°μ²΄λ“€μ˜ 곡동체
  • ecma-script2015
    • Object Literal Upgrades
    • default-parameter-template-literals-arrow-functions
    • spread-operator-rest-param
    • let-const-rest-parameter-spread-operator-destructuring
  • http
    • μ›Ή λΈŒλΌμš°μ €μ— URL을 μž…λ ₯ν–ˆμ„ λ•Œ μ–΄λ–»κ²Œ μ›Ή νŽ˜μ΄μ§€κ°€ λ³΄μ—¬μ§ˆκΉŒ?
  • jest
    • toThrow(error?)
  • data-structures
    • Data Structures
  • express
    • express generator
    • CORS
  • css-flexible-box-layout
    • flex 해버렸지 뭐야
  • git
    • Git
  • mongodb
    • MongoDB
  • markdown
    • use-markdown
  • cmder
    • cmd λͺ…λ Ήμ–΄ λͺ¨μŒ
  • debug
    • trackClicksEx function error
  • npm
    • NPM TOKEN μ„€μ •ν•˜κΈ°
  • storybook
    • Storybook
  • sort
    • Sorting Algorithms - part 1
  • javascript-koans
    • Javascript Koans μ˜€λ‹΅λ…ΈνŠΈ
  • rxjs
    • Rx.js
  • dom-elements
    • HTML Element
  • redux-toolkit
    • Redux Toolkit
  • github-actions
    • GitHub Actions
  • redux-middleware
    • redux middleware
  • rest
    • rest
  • css-rendering
    • μ½”λ“œ μŠ€ν”ΌμΈ  - CSS Rendering 1회차 2/2
    • μ½”λ“œ μŠ€ν”ΌμΈ  - CSS Rendering 1회차 1/2
  • you-dont-know-js
    • νƒ€μž…
  • server
    • # shutdown local server
  • semantic-versioning
    • Semantic Versioning 2.0.0
Powered by GitBook
On this page
  • init
  • status
  • add (stage area)
  • commit
  • log
  • 볡슡
  • stage, repository

Was this helpful?

  1. git-from-the-hell

init-status-add-commit-log-stage-repository

init

ν”„λ‘œμ νŠΈ 폴더λ₯Ό 버전관리 ν•˜κ² λ‹€.

git

이라고 μž…λ ₯ν•˜λ©΄

usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   merge      Join two or more development histories together
   rebase     Reapply commits on top of another base tip
   tag        Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.

이라고 λ– μ„œ λͺ…λ ₯어듀을 λ‹€ 확인 ν•  수 μžˆλ‹€.

git init 
# Initialized empty Git repository in dr/.git/
ls -al

.git μ΄λΌλŠ”κ²Œ μƒκ²Όλ‹€λŠ” κ±Έ 확인 ν•  수 μžˆλ‹€.

status

# vim을 μ΄μš©ν•΄ fi.txtλ₯Ό μˆ˜μ •ν•˜κ² λ‹€.
vim f1.txt

# μž…λ ₯μƒνƒœλ‘œ λ§Œλ“€ 수 μžˆλ‹€.
i

# escλ₯Ό λˆ„λ₯΄λ©΄ μž…λ ₯μƒνƒœλ₯Ό λΉ μ Έλ‚˜κ°ˆ 수 μžˆλ‹€.

# μž‘μ„±λ‚΄μš©μ„ μ €μž₯ν•˜κ³  vim을 μ’…λ£Œν•˜κ³  μ‹Άλ‹€.
:wp

# 파일이 μžˆλŠ”μ§€ ν™•μΈν•˜μž
ls -al

# 파일 λ‚΄μš©μ„ ν™•μΈν•œλ‹€.
cat f1.txt

txtνŒŒμΌμ„ λ§Œλ“€κ³  μ•ˆμ— λ‚΄μš©λ„ 넣어쀬닀.

git status

λ₯Ό μž…λ ₯ν•˜λ©΄

On branch master

No commits yet

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

        f1.txt

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

untracked - μΆ”μ λ˜κ³  μžˆμ§€ μ•ŠμŒμ„ λ§ν•œλ‹€. 폴더에 μƒνƒœλ₯Ό μ•Œ 수 μžˆλ‹€.

add (stage area)

이 νŒŒμΌμ„ 관리해~ commit λŒ€κΈ°μƒνƒœ - stage area

μ—¬λŸ¬κ°œμ˜ νŒŒμΌμ„ commit ν•  λ•Œ / μ„ νƒμ μœΌλ‘œ commit ν•  λ•Œ μœ μš©ν•˜κΈ° λ•Œλ¬Έμ— add λŠ” κΌ­ ν•„μš”ν•˜λ‹€.

git add f1.txt

commit

λ²„μ „μœΌλ‘œ λ§Œλ“€μ–΄ μ €μž₯ν•˜κΈ°

μ΄μ „μœΌλ‘œ λŒμ•„κ°ˆ 수 있고 변경사항을 확인 ν•  수 μžˆλ‹€.

버전 - μ˜λ―ΈμžˆλŠ” λ³€ν™”

On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

ν˜„μž¬μƒνƒœκ°€ add둜 νŠΈλ ˆν‚Ή 된 μƒν™©μ΄λΌλŠ” κ±Έ μ•Œ 수 μžˆλ‹€.

이름 μ…‹νŒ…

git config --global user.name sla 
git config --global user.email seula00027@gmail.com

λ”± ν•œλ²ˆλ§Œ ν•˜λ©΄ λœλ‹€.

commit ν•˜κΈ°

git commit

을 ν•˜λ©΄ vim이 싀행이 λœλ‹€.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
#
# Initial commit
#
# Changes to be committed:
#       new file:   f1.txt

ν˜„μž¬ λ²„μ „μ˜ λ©”μ‹œμ§€λ₯Ό μ“°μž. μ™œ 변경이 λ˜μ—ˆλŠ”μ§€ 'ㅁ'/

# μž…λ ₯μƒνƒœλ‘œ λ°”κΎΌλ‹€.
i

# 컀밋 λ©”μ‹œμ§€λ₯Ό μž…λ ₯ν•œλ‹€. 

#escλ₯Ό λˆ„λ₯Έλ‹€

#μ“΄ λ‚΄μš©μ„ μ €μž₯ν•˜κ³  vimμ’…λ£Œν•˜κΈ°
:wq

log

git log
commit 8617324471f8df5dc36e62c20e82609841745c8f (HEAD -> master)
Author: sla <blabla>
Date:   Wed May 22 18:40:05 2019 +0900

    1

μ»€λ°‹λ©”μ‹œμ§€μ™€ ν•¨κ»˜ 확인 ν•  수 μžˆλ‹€.

볡슡

# f2.txtλ₯Ό λ§Œλ“€κ³  μ»€λ°‹ν•˜μž
# vim νŒŒμΌμ„ λ§Œλ“€κ³  μ“°λŠ” κ±Έ λ™μ‹œμ— ν•  수 μžˆλ‹€. 
cp f1.txt f2.txt

# μž…λ ₯μƒνƒœλ‘œ λ§Œλ“ λ‹€
i
# μ“°κ³ μž ν•˜λŠ” λ‚΄μš©μ„ μž…λ ₯ν•œ λ’€
# Escλ₯Ό λˆ„λ₯Έλ‹€.
# μ €μž₯ν›„ vim μƒνƒœ λ²—μ–΄ λ‚˜κΈ°
:wq
# 잘 λ§Œλ“€μ–΄μ‘ŒλŠ”μ§€ ν™•μΈν•˜κΈ°
ls -al
# λ‚΄μš© 확인
cat f1.txt
# git 버전관리 μƒνƒœ ν™•μΈν•˜κΈ° Untracked 확인
git status

# git addν•˜κΈ°
git add
# 확인
git status 

# commit
git commit 
# λ©”μ‹œμ§€ μž…λ ₯
i 
# λ©”μ‹œμ§€ μž‘μ„±ν›„ Esc
# μ €μž₯ν›„ vim μƒνƒœ λΉ μ Έ λ‚˜μ˜€κΈ°
:wq

# commit ν›„ ν™•μΈν•˜κΈ°
git log

stage, repository

stage: addλ₯Ό μ™„λ£Œν•˜κ³  commit ν•˜κΈ°μ „ νŒŒμΌλ“€μ΄ κ°€λŠ” κ³³

repository: commitν•œ νŒŒμΌλ“€μ΄ κ°€λŠ” κ³³

PreviousgitNextlog-diff

Last updated 5 years ago

Was this helpful?