version control - Working with Git branches - Viewing / Adding and Commiting to them -
version control - Working with Git branches - Viewing / Adding and Commiting to them -
i've been reading working git branches
, know how create them , them, don't understand how come when ls
when i'm within new branch shows same files master
branch?
i'm trying create different version of library , wanted set branch -- confused why branch shows has files already?
also, commit branch assume git checkout mybranch
, run add
, commit
, push
commands 1 time within specific branch?
edit: assume see sames files because in same "physical location" , doesn't take business relationship branch in, guess got confused this page mentioning it.
so guess additional question is, there way view files within branch in?
what don't understand how come when ls
when i'm within new branch shows same files master
branch?
in git, branch pointer commit. branches "contain" multiple commits insofar each commit knows own parents.
if create new branch newbranch
master
, newbranch
point same commit master
:
c [master][newbranch] | b |
there no difference between 2 branches until create new commit in 1 of branches, moves branch pointer, e.g. creating new commit in newbranch
result in this:
d [newbranch] | c [master] | b |
so guess additional question is, there way view files within branch in?
as mentioned above, branch points commit.
tracked content (usually of content in repository) sensitive branch you've checked out. if commit d
above includes changes somefile.txt
, switching branches cause somefile.txt
change.
untracked content exclusively outside of git's purview, , not modified @ when alter branches.
git version-control branch git-branch
Comments
Post a Comment