Programming/DevelopTool

[git] Your branch is up to date with 'origin/master'

bisi 2020. 5. 12. 11:43

git init으로 저장소를 정상적으로 만들고, yml 파일을 github에 push 실행 시 발생했던 내용이다. 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
PS D:\docker-compose\cassandra> git commit -"upload docker-compose.yml file"
On branch master
Your branch is up to date with 'origin/master'.
 
Untracked files:
        docker-compose.yml
 
nothing added to commit but untracked files present
PS D:\docke-compose\cassandra> git status
On branch master
Your branch is up to date with 'origin/master'.
 
Untracked files:
  (use "git add <file>..." to include in what will be committed)
 
        docker-compose.yml
 
nothing added to commit but untracked files present (use "git add" to track)

 

git 저장소에는 원격저장소와 로컬 저장소로 나누어 지는데, 

원격 저장소에 push를 하려면 가상의 공간에 파일을 add 시켜야 실행할 수 있다. 

 

git status 로 확인하면, yml 파일을 git add를 실행하라고 친절하게 알려준다.

1
2
3
4
5
6
7
8
9
10
PS D:\docker-compose\cassandra> git status
On branch master
Your branch is up to date with 'origin/master'.
 
Untracked files:
  (use "git add <file>..." to include in what will be committed)
 
        docker-compose.yml
 
nothing added to commit but untracked files present (use "git add" to track)
 

 

그러니 당황하지 말고 git에서 가이드 해준대로 다시 실행해본다.

1
PS D:\docker-compose\cassandra> git add .

 

git status 다시 확인

1
2
3
4
5
6
7
8
PS D:\docker-compose\cassandra> git status
On branch master
Your branch is up to date with 'origin/master'.
 
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
 
        new file:   docker-compose.yml

 

정상적으로 add 된것을 확인하고, git commit 실행

1
2
3
4
PS D:\docker-compose\cassandra> git commit -"upload docker-compose.yml file"
[master 175fc33] upload docker-compose.yml file
 1 file changed, 81 insertions(+)
 create mode 100644 docker-compose.yml
 

 

git push까지 실행하면 원격 저장소 업로드 완료!

1
2
3
4
5
6
7
8
9
PS D:\docker-compose\cassandra> git push 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), 769 bytes | 384.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/hanbitlog/cassandra-docker-compose.git
   16ef1c4..175fc33  master -> master