git工作常用命令

安装工具:
git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prompt --depth=1

查看ssh配置文件:
~/.ssh/
ll ~/.ssh/

输出key:
cat ~/.ssh/id_rsa.pub

生成key:
ssh-keygen
cat ~/.ssh/id_rsa.pub
然后将生成的id_rsa.pub输出并配置到gitlab上面的个人的setting

设置远程仓库地址:
git remote set-url origin git@git.lksense.com:python/industrial-defect-detection.git

将当前修改的内容暂存到栈里面
git stash

展示保存的内容
git stash show

拉取远程最新代码
git pull

创建新的版本
git checkout -b ref.dev.device

stash内容弹出到新的版本:
git stash pop

查看pop之后当前版本的状态
git status

查看共同修改的地方:
git diff app/vrs/views.py

git add.

取消commit
git reset HEAD~1

commit:
git commit -m

push到远程指定版本:
git push -u origin ref.dev.device

12:01 # git push -u origin ref.dev.device -f
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: View merge request for ref.dev.device:
remote: http://git.lksense.com:9988/python/industrial-defect-detection/-/merge_requests/1464

访问 http://git.lksense.com:9988/python/industrial-defect-detection/-/merge_requests/1464
提交merge请求

git clone之后 可以用以下命令连接远程仓库:
source ~/.bashrc 使用工具
git remote set-url origin git@git.lksense.com:python/industrial-defect-detection.git

python setup.py sdist
可以打包

查看依赖:
pipreqs . --encoding=utf8 --force

不确定版本可以用 pip uninstall查看一下

每次不用输入账号密码
git config --global credential.helper store

git rebase --continue
git rebase --about (有解决不了的冲突)

git status

上传目标包:
twine upload -r lksense

参考:https://zhuanlan.zhihu.com/p/506645013

git cherry-pick 56edb33

/opt/virtualenvs/defect_detect/bin/python lk_compiler.py ‘/opt/software/industrial-defect-detection’ build_ext -i -j 8

watch -n 2 -10 /定时刷新文件

vim 全部替换

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值