๐ ํธ๋ฌ๋ธ์ํ
๋ฐฑ์ค ์ฌ์ดํธ๋ก ์ฝ๋ฉ ํ
์คํธ๋ฅผ ๋๋นํด ๊ณต๋ถํ๋ ์ค,
๊นํ๋ธ์ ์ฝ๋ ํ์ผ์ด ์ ํ์๋ ์ธํ
๋ฆฌ์ ์ด ํ์ผ์ ์ฐ๋ํ๊ธฐ ์ํด ์๋ํ๋๋ฐ ๋ฌธ์ ๋ฐ์ํด ์์ฑํ๋ ๊ธ์
๋๋ค!
๐ซฅ๋ฌธ์ ์ํฉ
.idea ํ์ผ์ด ํจ๊ป ์
๋ก๋๋์๋ค๐ข
๐ํด๊ฒฐ ๋ฐฉ๋ฒ
.gitignore ํ์ผ ์ถ๊ฐ
์ ๊ฐ ์ฌ์ฉํ .gitignore ๊ณต์ ํฉ๋๋ค.
# Created by https://www.toptal.com/developers/gitignore/api/intellij,java,gradle
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij,java,gradle
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/
# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml
# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/
# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$
# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml
# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml
### 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*
### Gradle ###
.gradle
**/build/
!src/**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties
# Cache of project
.gradletasknamecache
# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
### Gradle Patch ###
# Java heap dump
*.hprof
# End of https://www.toptal.com/developers/gitignore/api/intellij,java,gradle
๊ทธ๋ฌ๋ฉด, ๋ค์๊ณผ ๊ฐ์ด ํ์ผ์ด ์์ฑ๋ฉ๋๋ค.
-> .gitignore๋ ์ฒ์ ๋ ํฌ์งํฐ๋ฆฌ ์์ฑ ์๋ถํฐ ์์ด์ผ๋ง ์ ์ ์ฉ๋๋ค๋ ์ฌ์ค์ ์๊ฒ ๋์...๐ข
ํ์ง๋ง, ๊ทธ๋ผ์๋ ๋ฐฉ๋ฒ์ ์์ฃ ?
ํฐ๋ฏธ๋ ์ ์ ํ, ๋ค์์ ๋ช ๋ น์ด ์ ๋ ฅ์ผ๋ก ํด๊ฒฐ ๊ฐ๋ฅํ๋ค๋ ์ ๋ณด๋ฅผ ์ป์์ต๋๋ค.
git rm -r --cached .
git add .
git commit -m "clear git cache"
git push
git rm -r --cached .
git add .
git commit -m "fixed untracked files"
git push
-> fatal: Authentication failed for '์๊ฒฉ์ ์ฅ์ ์ฃผ์'
์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค๐ฎโ๐จ
๊นํ๋ธ์ ์ ์ฑ
๋ณ๊ฒฝ์ผ๋ก ์ธํด, ๊ธฐ์กด์ ID/Password ํ์์ ๋ก๊ทธ์ธ์์ Token์ผ๋ก ๋ฐ๋์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ ๊ฒ์
๋๋ค.
Github์์ Settings ์ ์ & ๋งจ ์๋ Developer settings ํด๋ฆญ
์๋ ์์์ ๋ฐ๋ผ ํด๋ฆญ ํ,Token ์์ฑ
ย
๋ค์ ํฐ๋ฏธ๋๋ก ๋์์์ ๋ค์์ ๊ณผ์ ์ ๊ฑฐ์นฉ๋๋ค.
git config --global user.name 'hayannn'
git config --global user.password '๋ณต์ฌํ Token ๋ถ์ฌ๋ฃ๊ธฐ'
git push
-> ์ด๋, ๋ค์ ํ๋ฒ ๊ณ์ ์ ๋ณด๋ฅผ ๋ฌป๋๋ค๋ฉด ๊ณ์ ์ ์์ด๋์ Token ๊ฐ์ ๋น๋ฐ๋ฒํธ๋ก ์ฌ์ฉํด์ ์ ์ฉํ์๋ฉด ๋ฉ๋๋ค.
๋ฌธ์ ํด๊ฒฐ์ด ์๋๋ค โ๏ธ
Github ๋ ํฌ์งํฐ๋ฆฌ์ ๋ค์ด๊ฐ ํ์ธํด๋ณด๋, ์ ์ฉ์ด ์๋์ด ์์ด ๋ค๋ฅธ ๋ฐฉ๋ฒ์ ์๋ํ์ต๋๋ค!
๋ณ๋์ Mac ํฐ๋ฏธ๋์ด ์๋ -> ์ธํ
๋ฆฌ์ ์ด์ ํฐ๋ฏธ๋์์ ๋ฐ๋ก ์ ์ฉ!
.idea ํด๋๊ฐ ์ ๋ก๋๋์ง ์๋๋ก .gitignore์ด ์ ์ฉ๋์์ต๋๋ค!
๐คญ ์ ๋ฆฌ
๐ .idea๋ฅผ Github ์
๋ก๋ ์ ์์ ์ผ ํ๋ ์ด์ ๋ ๋ฌด์์ธ๊ฐ์?
๐โโ๏ธ .idea์๋ ํ๋ก์ ํธ์ ๋ฒ์ ๋ฑ์ด ํฌํจ๋์ด ์๋๋ฐ, ์ด๊ฒ์ด ์ค๋ณต๋์ด commit ๋ ๊ฒฝ์ฐ, ๋ณธ์ธ ํน์ ํ ์ฌ์ฉ์๊ฐ cloneํ์ฌ ์ฌ์ฉํ ์ ๋ฒ์ ์ถฉ๋์ด ๋ฐ์ํ ์ ์์ต๋๋ค.
์ด๋ป๊ฒ ์์๋๊ตฌ์?
์ ๋ ์๊ณ ์ถ์ง ์์์ต๋๋ค....๐ผ
๐ .idea๋ฅผ ์ด๋ฏธ ๋ ํฌ์งํฐ๋ฆฌ์ commit ํ๋ค๋ฉด?
๐โโ๏ธ ํด๋น ๊ฐ๋ฐํด ๋ด์ Teminal์์ ๋ค์์ ์ฐจ๋ก๋๋ก ์
๋ ฅํด์ฃผ์ธ์.
git rm -r --cached .
git add .
git commit -m "clear git cache"
git push