#!/bin/bash
#read -p "add file name :" file
git add .
echo "add all file"
git status #git add 후 파일 상태 한번 확인 차원에서 추가함
read -p "git commit -m : " commit # read -p는 입력을 가능하게 해줌
for ((i=0; i<2; i++))
do
if [ -z "$commit"] ; then
echo "commit 메시지를 남겨주세요"
read -p "git commit -m : " commit
else
git commit -m $commit;
echo "commit 완료"
break
fi
done
git push origin master
for ((i=0; i<2; i++)) # 커밋메시지를 남기지 않을시 무한루프를 생각했지만
do # 원하는 대로 되지않아서 for문으로 최대 3번까지 commit 메시지 출력설정
if [ -z "$commit"] ; then # 처음에는 $commit =="" 값이 비어있다만 체크를 했는데
echo "commit 메시지를 남겨주세요" # 문자열이 오게되면 오류가 나서 -z 를 이용해서 문자열 null체크를 함
앞으로 수정해야 될 게 많다 일반 적인 파일변경후 push 는 잘 되지만 파일 삭제 후 push는 명령어가 달라져서
생각을 좀 해야 될 것 같다
[linux] Centos7 GitLab 서버 설치 (0) | 2022.07.06 |
---|---|
Changes not staged for commit: 깃허브 폴더 화살표 현상 (0) | 2022.06.27 |
VScode linux ssh 연결 하기 (0) | 2022.06.20 |
깃 브랜치 병합 하기(git branch merge) (0) | 2022.06.10 |
[git] git push / pull 기본적인 파일 올리고 받을 수 있는 (0) | 2022.05.31 |
댓글 영역