[root@centos7-1 datian_git]# git branch -a
* datian
master
remotes/origin/HEAD -> origin/master
remotes/origin/chenhy
remotes/origin/clown_dev
remotes/origin/datian
remotes/origin/echo
remotes/origin/gittest
remotes/origin/gzz02
[root@centos7-1 datian_git]# git checkout -b datian_dev
切换到一个新分支 'datian_dev'
[root@centos7-1 datian_git]# git branch -d datian_dev
错误:无法删除检出于 '/root/local_datian_git/datian_git' 的分支 'datian_dev'。
解决:先切换至其他分支,再执行删除命令
[root@centos7-1 datian_git]# git checkout datian
切换到分支 'datian'
[root@centos7-1 datian_git]# git branch -d datian_dev
已删除分支 datian_dev(曾为 ca728df)。
[root@centos7-1 datian_git]# git checkout datian
已经位于 'datian'
[root@centos7-1 datian_git]# echo '#datian 20221110修改了这个文件'>> start_ByIdo.sh
[root@centos7-1 datian_git]# cat start_ByIdo.sh
nohup ./gogs web >>/dev/null 2>&1 &
istester
#datian 20221110修改了这个文件
[root@centos7-1 datian_git]# git status
位于分支 datian
尚未暂存以备提交的变更:
(使用 "git add <文件>..." 更新要提交的内容)
(使用 "git restore <文件>..." 丢弃工作区的改动)
修改: start_ByIdo.sh
修改尚未加入提交(使用 "git add" 和/或 "git commit -a")
[root@centos7-1 datian_git]# git diff start_ByIdo.sh
diff --git a/start_ByIdo.sh b/start_ByIdo.sh
index f079337..4f86355 100644
--- a/start_ByIdo.sh
+++ b/start_ByIdo.sh
@@ -1,2 +1,3 @@
nohup ./gogs web >>/dev/null 2>&1 &
istester
+#datian 20221110修改了这个文件
[root@centos7-1 datian_git]# git add .
[root@centos7-1 datian_git]# git commit -m "datian 在start_ByIdo.sh文件找哪个加了一行注释"
[datian 6d775fd] datian 在start_ByIdo.sh文件找哪个加了一行注释
1 file changed, 1 insertion(+)
[root@centos7-1 datian_git]# git push origin datian:datian
Username for 'http://t.istester.com:3000': datian
Password for 'h