1. Cancel tracking of certain files or folders:
Delete an object:
$ Git Rm -- cached filename
Delete a folder:
$ Git Rm-r -- cached path
2. Ignore some files or folders
$ VI. gitignore
Every row in the file is an ignored item.
AA. Log, ignore AA. log;
*. Log: Ignore files ending with. log;
Pod/*, ignore all folders under the pod directory
3. Merge multiple commits:
$ Git rebase-I head ~ 2
Change the second pick to squash or S, and enter ": WQ" to exit.
Git automatically merges the second commit to the first commit. And prompt to enter a new message (which we often call comments)
Edit and enter a new message, and then enter ": WQ" to exit.
At this time, the last two local (head) commits have been merged into one. Git log can be viewed.
If you need to submit it to the remote end, run git push -- force origin master.
Common git commands