学习journal(三)ArmPiUltra使用
板子可以通过SSHVNC、MobaXterm、VSCode连接1编程写代码、开发推荐vscode可多个终端编程快捷键、代码检查等比较方便0515 2123发现SSH远程容器无法通过IDE打开脚本只能终端即使docker扩展也没有附加VScode的选项。决定手动搬运代码到windows具备相同目录结构的文件夹里用到什么脚本就搬运什么并且放github进行项目管理另外有cline或者copilotAIcoding也方便操作复制容器的代码到宿主机树莓派板子再下载到windows然后推送githubdocker cp ArmPiUltra:/home/ubuntu/ros2_ws/src /home/pi/my_code2追求性能/传文件用MobaXterm不过一般只能一个终端3VNC主要能像windows一样有图形界面vscode SSH连接方式进入容器ArmPiUltradocker exec -it -u ubuntu -w /home/ubuntu ArmPiUltra /bin/zsh1 开箱demo1.1 启动 launch 文件控制launch 文件位于/home/ubuntu/ros2_ws/src/example/example/simple/bus_servo.launch.pyros2 launch example bus_servo.launch.pygit push远程报错描述本地git init 默认分支是master远程新建仓库的默认分支是main直接执行 git push -u origin main报错$ git push -u origin main error: src refspec main does not match any error: failed to push some refs to github.com:xxx.git但执行git push -u origin master:main仍无法成功推送$ git push -u origin master:main To github.com:xxx.git ! [rejected] master - main (non-fast-forward) error: failed to push some refs to github.com:xxx.git hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. If you want to integrate the remote changes, use git pull hint: before pushing again. hint: See the Note about fast-forwards in git push --help for details.解决办法# 拉取远程内容并合并git pull origin main --allow-unrelated-histories --no-edit# 推送到远程git push -u origin master:main可以看到推送成功$ git pull origin main --allow-unrelated-histories --no-edit From github.com:xxx * branch main - FETCH_HEAD Merge made by the ort strategy. README.md | 6 1 file changed, 6 insertions() create mode 100644 README.md $ git push -u origin master:main Enumerating objects: 11, done. Counting objects: 100% (11/11), done. Delta compression using up to 24 threads Compressing objects: 100% (3/3), done. Writing objects: 100% (10/10), 746 bytes | 746.00 KiB/s, done. Total 10 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) To github.com:xxx.git ddxx4c3..015xx2e master - main branch master set up to track origin/main.git 强制修改远程最新提交git push --force-with-lease origin 本地分支名:远程分支名git push --force-with-lease origin master:main