투케이2K

7. (Bitbucket/Git) [BitBucket] [윈도우] Android 비트 버킷 프로젝트 및 저장소 생성 git 명령어 사용해 pull , commit , push 수행 본문

비트버킷 & Git

7. (Bitbucket/Git) [BitBucket] [윈도우] Android 비트 버킷 프로젝트 및 저장소 생성 git 명령어 사용해 pull , commit , push 수행

투케이2K 2022. 10. 22. 21:49
반응형

[환경 설정]

저장소 : Bitbucket / Git

사용 목적 : 소스 코드 버전 관리 실시

 

[참고 사항]

1. Commit : 로컬 저장소에 소스코드를 저장하는 것입니다. 2. Push : Git 에 실제로 소스코드를 반영하는 것입니다. 3. Pull : Git 에 등록된 소스코드를 내려받는 것입니다.
 

 

 

 

 

[윈도우에서 Git Bash 실행 >> 명령어 입력으로 commit , pull , push 수행]

# [cd 명령어를 사용해 안드로이드 프로젝트까지 이동 수행 실시]




# [프로젝트 내에서 git init 초기화]
$ git init

>> .git 파일 목록 확인 : ls -a

>> .git 파일 삭제 및 init 재수행 위함 : rm -rf .git





# [git 에 올리기 위해 소스 코드 전체 선택 실시]
$ git add --all





# [커밋 수행 및 멘트 저장 실시]
$ git commit -m "init"

>> unable to auto-detect email address 에러 발생 시 : 

    # [git config list 확인 명령어]
    $ git config --list

    # [user.email 추가 명령어]
    $ git config --global user.email "kgh@naver.com"

    # [user.name 추가 명령어]
    $ git config --global user.name = "TWOK"





# [비트 버킷에서 복사한 주소 설정 실시]
$ git remote add origin https://KwonGiHwan@bitbucket.org/KwonGiHwan/android-two2kmanager.git

>> 기존에 저장된 remote 저장소가 있어서 에러가 발생하는 경우 삭제 수행 : git remote remove origin





# [기존 소스코드 pull 당겨 받기]
$ git pull origin master

>> Not possible to fast-forward, aborting 에러 발생 시 : 

    # [pull rebase 당겨 받기 명령어]
    $ git pull --rebase

    # [fast-forward 옵션 비활성 명령어]
    $ git config --unset pull.ff





# [git 에 적용 push 설정 수행 실시]
$ git push origin master

>> fatal: Not possible to fast-forward, aborting 에러 발생 시 : 

    # [push 수행 명령어]
    $ git push origin +master





# [생성한 앱 비밀번호 고유값 입력 실시]

반응형
Comments