git - deleting from master but preserving branch -


i inherited messy repository. want trim master branch, keep test branch original files. problem when delete master branch delete test branch. how around this?

edit: delete files.

thanks downvotes. i'm new git.

example

suppose have repository 2 files: file1.txt , file2.txt. here doing:

  1. download remote repository: git fetch [remote repository url]
  2. create branch: get branch test
  3. i'm on master branch. want keep master branch clean of file1.txt keep in test branch. delete it: git rm file1.txt
  4. now let's switch test branch: git checkout test
  5. i see file1.txt deleted branch

why that? naive understanding actions on 1 branch did not affect actions on unless merged.

in git, each branch pointer sha1 identifies commit tree.

you should able change master branch in whichever way see fit, without affecting other branches.

of course, not it'll easy subsequently merge changes between such branches, so, @ 1 point, might start new repo scratch.


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -