darrenji

创建一个空目录,在其中初始化git


git init


创建一个新文件,此时默认在master分支上


touch file1.txt


add到staging area


git add file1.txt


提交变化


git commit -m \'the first commit\'


创建一个新的分支


git branch newBranch


切换到新的分支


git checkout newBranch


在新的分支newBranch下创建目录和文件


mkdir folder
touch folder/file2.txt


在新的分支newBranch下add刚添加的目录和文件


git add folder

提交变化


git commit -m \'second commit\'


来到默认分支


git checkout master
此时,在newBrach分支上创建的folder目录是不可见滴。

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-06-17
  • 2021-08-04
  • 2022-12-23
  • 2021-12-27
  • 2021-08-02
猜你喜欢
  • 2021-05-04
  • 2022-01-17
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
相关资源
相似解决方案