软件测试所有内容笔记正在陆续更新中,笔记已经在本地记录,全部为自己手动记录的笔记及总结,正在开始更新中,后续会逐步更新并完善到
软件测试学习内容总结
专栏。
本节内容为常用的一些命令等,后续会陆续增加其他内容。
pip 使用
pypi官网:http://www.pypi.org
-
升级pip
python -m pip install -U pip
python -m pip install --upgrade pip
- easy_install --upgrade pip 当pip升级失败时使用
-
pip install 包名==版本号
- pip install selenium==2.39.0
-
pip install 包名 -i 镜像地址 --trusted-host 镜像地址对应的host
- 举例:pip3 install jupyter -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
-
pip install -U 包名
升级包 (pip install --upgrade) -
pip uninstall 卸载
-
pip list 列出所有的包文件
-
pip download 下载包
-
pip search requests 搜索包
镜像
- 阿里云: https://mirrors.aliyun.com/pypi/simple
- 清华: https://pypi.tuna.tsinghua.edu.cn/simple
- 豆瓣: http://pypi.douban.com/simple
阿里云 18.04LTS 镜像源 bionic
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
Git GitHub
在开源生态领域,Star星标,可以理解为“点赞”,代表着项目的受欢迎程度;Fork是其他用户仓在你的帐户上的个人副本,标示着项目的流行度。
创建代码仓库
echo “# FIS03” >> README.md
git init
git add README.md
git commit -m “first commit”
git branch -M main
git remote add origin https://github.com/Chan0619/FIS03
git push -u origin main
git add [文件名] – 添加单个文件
git add . – 添加目录下所有的文件
git commit -a -m
如果使用git commit -am,则可以省略git add a.txt这一步,因为git commit -am可以提交跟踪过的文件,而a.txt一开始已经被跟踪过了(使用git add a.txt命令提交过了)
Git 问题解决
问题一:Git Pull Failed
refusing to merge unrelated histories
原因分析:一般这个错误会出现在git pull命令,即系将远程仓库的内容拉取到本地仓库进行合并,本地仓库的内容要去推送到远程仓库, 但是远程仓库与本地仓库出现冲突,远程仓库会进行排异, 所以告知无法合并,拉取失败。
解决方法:使用以下命令强制拉取远程仓库的内容,后面加上 --allow-unrelated-histories , 把两段不相干的分支进行强行合并
git pull origin master --allow-unrelated-histories
问题二:git push origin master
git push -u origin master
原因分析:从远程仓库 clone 来的项目里包含了其他文件(如README.md这个文件),但是自己本地仓库里没有这些文件,也即系远程仓库与本地仓库的文件结构不一致解决方法:在push之前,使用以下命令合并远程仓库与本地仓库,使它们的文件结构保持一致
git pull --rebase origin master