- working Directory : git add ์ ์ ์ํ
> git status
On branch main
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
nothing added to commit but untracked files present (use "git add" to track)
- staging Area : git add ํ์ ์ํ
> git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .gitignore
- Git repository(Local) : add ํ, git commit -m์ ํตํ์ฌ Local์ ์ ์ฅ
> git commit -m ".gitignore ํ์ผ ์์ฑ"
[main 7c9e78c] .gitignore ํ์ผ ์์ฑ
1 file changed, 1 insertion(+)
create mode 100644 .gitignore
- Git repository(Remote) : ์ปค๋ฐ๋ฉ์์ง ๋ฑ๋ก ํ, git push๋ฅผ ํตํ์ฌ Remote์ ์ ์ฅ
> git push origin main
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 301 bytes | 301.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 https://github.com/Gyuuul/Node.js.git
1268470..7c9e78c main -> main
1. GitHub์์ repo ์์ฑ
2. repo ์ฃผ์ ๋ณต์ฌ
3. ์๊ฒฉ ์ ์ฅ์ ์ง์
$ git init
$ git remote add origin [ ๋ณต์ฌํ ์ ์ฅ์ ์ฃผ์ ]
4. ์๊ฒฉ ์ ์ฅ์ ๋ด์ฉ์ ๋ก์ปฌ ์ ์ฅ์์ ๋ฐ์ (๊ทธ๋์ผ push ์๋จ)
$ git pull origin main --allow-unrelated-histories