Notice
Recent Posts
Recent Comments
Link
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

main

[Git] 프로젝트 git 생성 및 원격 저장소 push (.gitignore 파일 추가) 본문

ETC

[Git] 프로젝트 git 생성 및 원격 저장소 push (.gitignore 파일 추가)

1984 2023. 4. 25. 02:22

1. git 초기화

git init

2. .gitignore 파일 추가

아래 URL에서 gitignore 서식 생성하여 파일을 추가한다. (.git 폴더가 있는 위치에 넣어준다.)

https://www.toptal.com/developers/gitignore/ 

 

gitignore.io

Create useful .gitignore files for your project

www.toptal.com

# Created by https://www.toptal.com/developers/gitignore/api/windows,eclipse,java,maven
# Edit at https://www.toptal.com/developers/gitignore?templates=windows,eclipse,java,maven

### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/
.apt_generated_test/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project

### Eclipse Patch ###
# Spring Boot Tooling
.sts4-cache/

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/windows,eclipse,java,maven

3. 변경 사항을 스테이징(staging) 영역에 추가한다.

git add .

4. commit

git commit -m "커밋 메시지"

5. 원격 저장소 추가

원격 저장소 이름은 일반적으로 origin으로 사용한다.

// 원격 저장소 추가
git remote add <원격 저장소 이름> <원격 저장소 URL>

// 원격 저장소 확인
git remote -v

6. 원격 저장소에 push

git push <원격 저장소> <브랜치 이름>

7. 끝.

 

* git config 설정

git config user.name "name"
git config user.email "email"
git config --global core.autocrlf true

 

728x90
Comments