有時在我做了一個提交後,我發現我遺漏了一個文件,該文件也應該包含在提交中,但實際上沒有。我經常做的是再次提交。如何將文件添加到最後一次提交的git的?
git add the_left_out_file
git commit "include the file which should be added in the last commit"
我認爲這可能不是一個好主意,這樣做,我想要做的就是包括不添加提交文件。類似這樣的,
git add the_left_out_file
git add_staged_files_to_previous_commit
這可能嗎?
也是,另一種解釋相同:http://stackoverflow.com/questions/26050327/how-does-git-commit-amend-work-exactly – quetzalcoatl