vscode使用tmux技巧

发布于:2025-09-14 ⋅ 阅读:(18) ⋅ 点赞:(0)
  1. 生成会话
tmux
tmux new -s <session-name>

  1. 退出当前会话
tmux detach
exit
  1. 查看有什么会话
tmux ls
  1. 再次链接会话
tmux attach -t <session-name>
  1. 删除会话
tmux kill-session -t <session-name>
  1. 重命名会话
tmux rename-session -t <new-name>
  1. 切换会话
tmux switch -t <session-name>

回溯log ctl+b 上下键



git stash

临时保存工作区和暂存区的修改
典型使用场景包括

  1. 当你正在一个分支上开发,突然需要切换到另一个分支处理紧急问题,但当前修改还没完成不想提交
  2. 需要拉去远程最新代码,但本地i修改与远程有冲突
  3. 想临时回答某个干净状态测试或查看代码

常用操作:
保存当前修改

git stash

会把工作区和暂存区的修改保存到一个 “储藏栈” 中,工作区恢复到最近一次提交的状态
查看储藏列表

git stash list

会显示所有保存的储藏,格式类似:stash@{0}: WIP on 分支名: 提交哈希 提交信息
恢复最近的储藏

git stash apply  # 恢复后,储藏仍会保留在栈中
# 或
git stash pop    # 恢复后,会删除该储藏(推荐日常使用)

恢复指定的储藏

git stash apply stash@{n}  # n是储藏的编号,如stash@{1}

删除指定储藏

git stash drop stash@{n}

删除所有储藏

git stash clear

使用huggingface下载模型

  1. 本地 git clone 下载
    git clone 网址(modelcard)
    在这里插入图片描述

  2. 服务器镜像下载

pip install -U huggingface_Hub

设置环境变量

export HF_ENDPOINT=https://hf-mirror.com
export HF_ENDPOINT=https://hf-mirror.com && huggingface-cli download --resume-download gpt2 --local-dir gpt2
  1. modelscope下载
pip install modelscope

命令行下载

modelscope download --model llava-hf/llava-1.5-7b-hf ....

SDK下载

#模型下载
from modelscope import snapshot download
model dir =snapshot download('llava-hf/llava-1.5-7b-hf')

git下载

git lfs install
git clone https://www.modelscope.cn/llava-hf/llava-1.5-7b-hf

如果您希望跳过 Ifs 大文件下载,可以使用如下命令

GIT LFS SKIP SMUDGE=1 git clone https://www.modelscop