메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


git git 초기화(Windows에서 Git Bash사용)

총관리자 2016.11.17 14:41 조회 수 : 3607


1. 현재 sdaf프로젝트는 3개의 하위프로젝트를 가지고 있는 경우임


2. 작업할 폴더(예, sdaf)로 이동한다.

  cd ./sdaf


3. 기존의 모든 히스토리 삭제

rm -rf .git


4. 현재 소스들로 git repository 다시 생성하기

git init

git add .

git commit -m "Initial commit"


5. 올리지 말아야 할 파일(설정정보, 비밀번호등 노출되면 안되는 정보파일)을 최상위폴더(.git디렉토리가 있는)에 .gitignore 파일에 생성하고 commit한다.

  가. echo "SdaConstant.java" >> .gitignore

  나. echo "context-datasource.xml" >> .gitignore

  다. git add .gitignore

  라. git commit -m "Add SdaConstant,context-datasource to .gitignore"


* .gitignore파일에 등록할 내용 예시


SdaConstant.java

context-datasource.xml  

db.properties

build/

bin/

target/

build.gradle

dependency-reduced-pom.xml

.settings/

*.swp

.classpath

.project

.springBeans 


6. GitHub에 push하기

git remote add origin https://github.com/iotoasis/SDA.git

git push -u --force origin master


* git push하면 원격저장소의 모든 내용이 로컬에서 등록한 내용으로 바뀌게 된다.



*참고: 하위의 *.svn을 모두 삭제해줌

find . -name .svn -print0 | xargs -0 rm -rf

번호 제목 날짜 조회 수
35 .git폴더를 삭제하고 다시 git에 추가하고 서버에 반영하는 방법 2017.06.19 8626
34 build.gradle을 pom.xml로 변환하는 방법 2016.08.18 5011
33 [sbt] sbt-assembly를 이용하여 실행에 필요한 모든 j라이브러리를 포함한 fat jar파일 만들기 2016.07.11 4556
32 원격 리포지토리에서 최초 clone시 Permission denied (publickey). 오류발생시 조치사항 2017.06.20 4516
31 [SBT] assembly시 "[error] deduplicate: different file contents found in the following:"오류 발생시 조치사항 2016.08.04 4488
30 .gitignore파일에 지정되지 않은 파일이 ignore되는 경우 확인방법 2016.11.22 4421
29 [bitbucket] 2022년 3월 2일 부터 git 작업시 기존에 사용하던 비빌번호를 사용할 수 없도록 변경되었다. 2022.04.30 4241
28 ubuntu에 maven 3.6.1설치 및 환경변수 설정 2019.06.02 4156
27 [sbt] sbt 0.13.11 를 windows에 설치하고 scala프로그램을 compile해서 jar파일 만들기 2016.07.11 3943
26 Eclipse 에서 bitbucket.org 연동 하기 file 2017.06.08 3889
25 [SBT] project.sbt에 libraryDependencies에 필요한 jar를 지정했으나 sbt compile할때 클래스를 못찾는 오류가 발생했을때 조치사항 2016.08.03 3806
24 로컬에 있는 jar파일을 지정하고 dependency로 가져오기 2016.08.19 3763
23 특정 커밋 시점(commit id를 기준으로)으로 돌리기(reset) 2016.11.21 3732
22 원격의 origin/master를 기준으로 dev branch를 만들어 작업후 원격의 origin/dev에 push하는 방법 file 2016.11.22 3686
21 build할때 unmappable character for encoding MS949 에러 발생시 조치사항 2016.08.03 3674
20 원격에 있는 git를 받은후 기존repository삭제후 새로운 리포지토리에 연결하여 소스 등록 2019.07.13 3663
» git 초기화(Windows에서 Git Bash사용) 2016.11.17 3607
18 spark submit용 jar파일을 만드는 sbt 용 build.sbt설정 파일(참고용) 2016.08.19 3561
17 compile할때와 exclude할때 대상을 표현하는 명칭이 다르므로 주의할것 2016.08.10 3451
16 특정 단계의 commit상태로 만들기(이렇게 하면 중간에 반영된 모든 commit를 history가 삭제된다) 2016.11.17 3391
위로