IT 이것저것

[GIT/명령어] Git Push 명령어

2것저것 2022. 10. 19. 16:00
728x90
반응형

Push 작업

  • commit 한 내용을 원격 저장소에 저장하는 작업
root@PC25:~/git/TEST/Python/ajh# git push -u origin master
Username for 'https://192.168.1.2': jhhh
Password for 'https://jh@192.168.1.2':
To https://192.168.1.2/test/TEST.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://192.168.1.2/test/TEST.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
root@PC25:~/git/TEST/Python/ajh#

push 하는데 에러가 발생함. 다른 사용자가 push 하여 저장소가 변경되어 에러 발생함. 이 경우 다시 pull로 받아온 후 push 해주면 됨

 

 

-- pull 수행 ---

pull로 당겨오니 변경된 사항이 있었음

root@PC25:~/git/TEST_QA/Python/ajh# git pull https://192.168.1.2/TEST/TEST_QA.git/ master
Username for 'https://192.168.1.2': jhhh
Password for 'https://jhhh@192.168.1.2':
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From https://192.168.1.2/TEST/TEST_QA
* branch master -> FETCH_HEAD
Merge made by the 'recursive' strategy.
Bash/user2/base64en.py | 17 +++++++++++++++++
Bash/user2/TEST_memwrite.sh | 33 +++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
create mode 100755 Bash/user2/base64en.py
create mode 100755 Bash/user2/TEST_memwrite.sh
root@PC25:~/git/TEST_QA/Python/ajh#

 

 

push 성공

root@PC25:~/git/TEST_QA/Python/user2# git push -u https://192.168.1.2/TEST/TEST_QA.git/ master
Username for 'https://192.168.1.2': jhhh
Password for 'https://jhhh@192.168.1.2':
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.58 KiB | 1.58 MiB/s, done.
Total 7 (delta 3), reused 0 (delta 0)
To https://192.168.1.2/TEST/TEST_QA.git/
18fe2de..93d07ff master -> master
Branch 'master' set up to track remote branch 'master' from 'https://192.168.1.2/TEST/TEST_QA.git/'.
root@PC25:~/git/TEST_QA/Python/user2# cd ..
728x90
반응형