乐趣区

关于github:git操作

github 创立新 branch 办法

code->main, 输出新 branch 名,create branch:

[postgres@hgcndn git_test]$ git pull
 * [new branch]      dev        -> origin/dev
Already up-to-date.
[postgres@hgcndn git_test]$ git branch -a
* main
  remotes/origin/HEAD -> origin/main
  remotes/origin/dev
  remotes/origin/main

删除所有文件

[postgres@hgcndn git_test]$ git rm * -r
rm 'README.md'
[postgres@hgcndn git_test]$ git add .
[postgres@hgcndn git_test]$ git commit -m "clean all files"
[dev 3f73979] clean all files
 1 file changed, 6 deletions(-)
 delete mode 100644 README.md
[postgres@hgcndn git_test]$ git push origin dev
Counting objects: 3, done.
Compressing objects: 100% (1/1), done.
Writing objects: 100% (2/2), 236 bytes | 0 bytes/s, done.
Total 2 (delta 0), reused 0 (delta 0)
To git@github.com:xiangbin1997/git_test.git
   5c9dcce..3f73979  dev -> dev
退出移动版