Recently, I was using git and started to operate on the idea interface. Later I asked to use command lines. At the beginning, I was not very used to it. I felt very troublesome. After using it for a few days, I felt very good!
In fact, there are not many git commands, and you will be able to use them smoothly after a while. Various problems have been encountered during use, and some small problems are summarized here.
1. Idea command line. After git is installed, it comes with the terminal git bash, which is easy to use. However, it is difficult to open git bash in the corresponding folder after development using idea. In fact, idea also has terminal, which can be found at the bottom and can be executed here. However, if git is installed by default, you cannot enter the GIT command in the idea terminal because the path is not configured. In fact, when installing git, note that the third option is to automatically configure the path installation method. Select the installation method. In this way, you can operate git directly on the idea terminal.
2. Undo commit and submit again. Commit made some changes, but found that there was an error. In fact, you can append the Amend with the error modification. However, if we use Gerrit and push, this commit is abandon, so that we cannot use the same changid for submission. In this case, you need to cancel the commit, but keep the code modification and resubmit it again. In this case, you can git reset -- mixed ***** (*** is the ID of the previous commit) to cancel this submission and retain the changed source code, then, click Add-> commit.