[Rails 5] Countermeasures for git commit failure from another branch in Docker environment

I'm creating a Rails app in my first Docker environment. Commit from another branch failed and it took a long time to resolve I will write it as a memorandum so that I can deal with the same error immediately.

Cause

Because the .postges directory was managed by git

solution

・ Describe .postgres in .gitignore → After that, even if you push it, it remains on github

Matters that are described in .gitignore but are not reflected → Please refer to this page for caching. After pushing from the commit, it disappeared from github!

After that, I created another branch and confirmed that I was able to commit and push.

However, when I switched to the branch with the error, I got the same error, so Most of the work I was doing today has disappeared. .. ..

Also, I would like to do my best from scratch! !!

Summary

I'm a beginner in programming, so I courageously posted it to Teratail, I don't get a good answer at all There are many people who don't give an answer and make a fool of themselves, so In the future, I thought that I had no choice but to improve my ability to solve errors myself (o'∀') ノ

Recommended Posts

[Rails 5] Countermeasures for git commit failure from another branch in Docker environment
Build an environment for Rails projects under Git management in Cloud9
Show Better Errors in Rails + Docker environment
Build a development environment for Docker + Rails6 + Postgresql
(Basic authentication) environment variables in rails and Docker
Migration error after Activerecord association in Rails5 + Docker environment (2)
Migration error after Activerecord association in Rails5 + Docker environment
SSL in the local environment of Docker / Rails / puma
Rails Docker environment construction
Exit code 1 occurs when Rails is stopped in Docker environment
[Docker context] ~ How to access docker in remote environment from VScode ~
Configuration script for using docker in proxy environment on ubuntu 20.04.1
[Docker] Rails 5.2 environment construction with docker
Use MailHog for checking emails in the development environment (using Docker)
Rails 6 (API mode) + MySQL Docker environment creation by docker-compose (for Mac)
Procedure for building a Rails application development environment with Docker [Rails, MySQL, Docker]
Install lsb_release from the command line when lsb_release fails in docker environment
"Rails 6 x MySQL 8" Docker environment construction procedure for sharing with teams