Programing/Git

git + hub 이해, 가입, 등록

kgmcscs 2018. 2. 27. 14:49

Git (/ɡɪt/) is a version control system for tracking changes in computer files and coordinating work on those files among multiple people. It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files. As a distributed revision control system it is aimed at speed, data integrity, and support for distributed, non-linear workflows.

Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development.] Its current maintainer since 2005 is Junio Hamano.

As with most other distributed version control systems, and unlike most client–server systems, every Git directory on every computer is a full-fledged repositorywith complete history and full version tracking abilities, independent of network access or a central server.

Git is free and open source software distributed under the terms of the GNU General Public License version 2.


1. 컴퓨터 파일의 변경 사항을 추적하고 여러사람 사이의 파일에 대한 작업 조정을 하는 버전 관리 시스템

2. 주로 소프트웨어 개발의 소스코드 관리에 사용된다. 

3. 파일의 집합 변경 내용에 추적하는데 사용할수 있다. 

4.서버 시스템및 네트워크에 영향이 없이 완전한 기록 및 추적을 같은 저장소.


GitHub (originally known as Logical Awesome LLC) is a web-based hosting service for version control using git. It is mostly used for computer code. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug trackingfeature requeststask management, and wikis for every project.

GitHub offers plans for both private repositories and free accounts which are commonly used to host open-source software projects. As of April 2017, GitHub reports having almost 20 million users and 57 million repositories, making it the largest host of source code in the world.

GitHub has a mascot, an "Octocat" called Mona, a cat with five tentacles and a human-like face.

1. git 을 이용한 웹 기능 호스팅 서비스

2. 주로 컴퓨터 코드를 사용. 

3. 분산 버전 제어 및 SCM(소스 코드 관리)  

4. 엑세스 제어 및 여러 공동 작업 기능, 버그 추적,  기능요청, 작업관리, 및 위키 기능 제공

5. 오픈소스 기반의 프로젝트를 위한 무료 계정 및 저장소 제공. 

6. 세계에서 가장 많은 소스코드 제공.



https://commons.wikimedia.org/wiki/File:Git_operations.svg

참고 

git pull
원격 변경 사항을 로컬 복제본으로 가져 와서 현재 작업 파일에 병합합니다.
git checkout
현재 작업 파일을 분기의 파일로 바꿉니다.
git checkout --track
원격 브랜치에서 로컬 브랜치를 작성하고 링크하며 현재 작업 파일을 해당 브랜치의 파일로 대체합니다.
git fetch
변경 사항을 원격 저장소에서 로컬 복제본으로 다운로드합니다.
git reset
현재 분기점이 특정 개정 또는 분기를 가리 키도록 만듭니다.
git reset --hard
현재 분기점을 특정 개정판이나 분기점으로 만들고 현재 작업 파일을 해당 분기의 파일로 대체합니다.
git merge
주어진 브랜치의 파일을 현재 브랜치에 병합합니다.
git push
변경 사항을 로컬 브랜치에서 해당 원격 리포지토리로 업로드합니다.
git add
현재 작업중인 파일을 스테이지 (인덱스 또는 캐시)에 넣습니다.
git commit
로컬 브랜치에 대한 단계적 변경 사항을 커밋합니다.
git commit -a
수정 된 모든 파일을 로컬 브랜치에 위탁합니다 ( "git add"와 "git commit"의 줄임말).



github의 일원되기! 

회원 가입은 어렵지 않습니다. 아이디 및 이메일 그리고 패스워드 입력 하면 쉽게 가입이 됩니다. 

그 이후 입력 정보는 설정에 대한 정보이기 때문에 그냥 넘어 가도 상관없습니다. 


1. 회원 가입하기. 

https://github.com/



2. Choose your plan Next 누르기 

사용자가 github을 어떻게 사용할지 정하는 화면이 입니다. 나중에 전환 할수 있으므로 우선은 넘어 갑니다. 



3.  welcome to GitHun  submit 누르기 

사용자의 정보를 제공하기 위한 페이지 입니다. 프로그래머의 수준과 간략한 정보를 Github에 제공합니다. 


4. 등록한 이메일로 확인 메일이 날아 옵니다. 메일에 첨부된 url을 클릭하면 등록 완료 됩니다. 


complite. 



프로젝트 등록하기. 


1.  프로젝트 등록하기.

아래와 같이 두가지 방법을 제공합니다. 






2. 프로젝트 설정 하기

2.1 "Repository Name" 에 자기의 프로젝트 이름을 입력합니다.

한사람이 여러개의 프로젝트를 제작 할수 있습니다. 


2.2 "Description" 에 프로젝트의 간략한 설명을 입력합니다.

한사람이 여러개의 프로젝트를 제작 할수 있습니다. 


2.3 기본적으로 Public으로 사용합니다. Private 를 설정하면 결제 하기 위한 정보를 제공합니다. 

GitHub는 기본적으로 오픈소스를 지향 합니다. 오픈소스를 위해 무료 계정과 저장소를 제공합니다. 하지만 비공개 프로젝트를 진행 하려면 월 7달러를

지불하여 이용해야 합니다 


3. 프로젝트의 소스를  Eclipse에서 GitHub에 등록하기

3.1 eclipse에서 프로젝트에 git을 생성합니다 .


3.1.1 Package Explorer 에서 메뉴 박스를 선택하여 그림과 같이 Share Project를 선택합니다. 


3.1.2 Use or Create Repository in Parent...... 를 체크 해줍니다. 



3.1.3 Create Repository를 선택 하고 Finish를 클릭하여 완료 합니다. 



3.2  Git Pespactive에서 Remote 서버 추가하기. 

3.2.1 Eclipse의 오른쪽 상단에 Open Perspactive 버튼을 선택하여 Git을 선택합니다. 

3.2.2  Remotes를 선택하여 오른쪽 클릭하여 New Remote를 선택합니다. 


3.2.3 OK를 누릅니다. 


3.2.4 Change.. 버튼을 클릭하여 Remote Server의 정보를 입력합니다. 


3.2.5 GitHub사이트에서 URL을 복사해서 가져옵니다.  그리고 아이디 및 패스워드를 입력합니다. 


3.2.6 Eclipse의 해당창에서 ctr+c를 누르면 자동으로 추가 됩니다. 


3.2.6 Remote서버가 추가 되었습니다 완료! 



4. git 설치 하기. 

https://git-scm.com



4. Terminal 에서  프로젝트 등록하기. 


-  자신의 경로로 이동하기 .

아래와 같이 경로를 확인 하여  

- cmd창에서 "cd 자신의 경로"를 입력합니다. 



cd 해당프로젝트/패스 ex> cd c:/project/hellowold git init git add src git commit -m "first commit" git remote add origin https://github.com/xxx/testProect2.git git push -u origin master