Eclipseの共有をsrcとWebContentだけにする(サーブレットJSP)
まず、以下のような .gitconfig を用意する。
# 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*
# add by SeiichiN
/Servers/
.settings/
build/
.classpath
.project
META-INF/
/.metadata/
# necesarry
!jstl-api-1.2.jar
!jstl-impl-1.2.jar
!ojdbc7.jar
.gitignore があるフォルダで コマンドプロンプトを起動。
以下を実行。
> git fetch origin
> git status
これでもし、GitHub(共有)に更新されたものがあれば、ここに表示される。
もし、更新されたものがあれば、取り込む。 取り込んだ場合は、その状態でプロジェクトが動作することを確認しておく。
現在が完全に動作できていることが必要。
動作確認ができれば、以下を実行。
> git rm -r --cached .
> git add .
> git commit -m "srcとWebContentだけ共有する"
> git push -u origin main
カテゴリー: Eclipse, Git, memo
タグ: Eclipse, Git, jsp, servlet, src, webcontent
カウント: 213