代码改变世界

17_8_30 git常用指令详解

2017-08-30 19:27  小歪1991  阅读(129)  评论(0编辑  收藏  举报

初始化:
git init
关联远程仓库:
git remote add origin https://github.com/githubname/Test1.git    //origin 是自己取的名字
查看远程仓库
git remote
git remote -v
解除远程仓库链接
git remote rm videop

步骤:
1.git add 项目名
2.git commit -m "对此次提交的描述"
3.git push self master 提交
4.git pull self master 拉取

参考

删除
git rm --cached "文件路径"--->不删除物理文件,仅将该文件从缓存中删除
git rm --f  "文件路径"--->不仅将该文件从缓存中删除,还会将物理文件删除(不会回收到垃圾桶)

参考

git clean  -d  -fx ""
-x means ignored files are also removed as well as files unknown to git.
-d means remove untracked directories in addition to untracked files.
-f is required to force it to run.

查看 记录:commit 的记录
git log 
查看.git 目录下的其他工程是否被追踪(add)
git status 
git status -s