git remote 命令

 

 git remote -v  作用是显示所有远程仓库

 

 git remote show xx (xx为远程地址的别名) 显示某个远程仓库的信息

 

git remote add [name] [url]  作用是添加远程版本库

 

git remote rm name 

 

git remote rename old_name new_name 

----------------------------------------------------------------------------------------------------

git clean 从你的工作目录中删除所有没有 tracked,没有被管理过的文件

n :显示将要被删除的文件

d :删除未被添加到 git 路径中的文件(将 .gitignore 文件标记的文件全部删除)

f :强制运行

x :删除没有被 track 的文件

 

git reset --hard  reset 影响被 track 过的文件 (回退到上一个 commit)

所以需要 clean 来删除没有 track 过的文件,reset 删除被 track 过的文件

结合两命令 → 让你的工作目录完全回到一个指定的 <commit> 的状态

-----------------------------------------------------------------------------------------------------------

 
posted on 2023-09-04 11:10  孤独斗士  阅读(4)  评论(0编辑  收藏  举报