能放出来的都放出来,在一个地方比较好管理,自己碰到的几个常用命令吧。
使用
已经追踪的文件,后面放到ignore里了,如何处理
.gitignore
will prevent untracked files from being added (without an add -f) to the set of files tracked by git, however git will continue to track any files that are already being tracked.To stop tracking a file you need to remove it from the index. This can be achieved with this command.
git rm --cached <file>
If you want to remove a whole folder, you need to remove all files in it recursively.
git rm -r --cached <folder>
The removal of the file from the head revision will happen on the next commit.
WARNING: While this will not remove the physical file from your local, it will remove the files from other developers machines on next git pull.
迁移 bitbucket 到 github
这里可以用官方的 GitHub Desktop 来偷懒不用提前创建好 GitHub 上的仓库。
GitHub Desktop 可以直接帮你 push 创建。
|
参考
How to make Git “forget” about a file that was tracked but is now in .gitignore?