version control - Two parallel independet branches in the same repo in git -
i new git , trying learn new stuff.
i want know possible have 2 branches independent of each other (no common ancestor) in same repo.
illustrative example:
let's imagine have repo stored in git@git.somedomain.com. under ~/git/ have many directories (mydir1, mydir2, mydirn...) holding code have obtained doing:
git clone git@git.somedomain.com:my-repo-1git clone git@git.somedomain.com:my-repo-2, on...
now want move ~/git/mydir1/scripts ~/scripts/ because want keep scripts separate source code stored in ~/git/mydir1
i go ~/scripts , execute git init create local repo scripts.
and there stuck.
questions:
- how push local repo
git@git.somedomain.com:my-repo-1? - how content of
~/scripts(the newly pushed branch) in~/somescriptson other pc?
i apologize beforehand if have abused git terminology, still trying learn branch, remote, origin etc. mean.
is possible have 2 branches independent of each other in same repo.
in same repo, called orphaned branch, not doing in question.
trying split repo in two, removing folder history 1 repo (~/git/mydir1, folder scripts/)and importing history in second new repo (~/scripts)
how push local repo
git@git.somedomain.com:my-repo-1?
cd ~/scripts git remote add origin git@git.somedomain.com:my-repo-1 but need have @ least 1 commit before being able git push -u origin master
for that, see splitting subfolder out new repository
how content of
~/scripts(the newly pushed branch) in~/somescriptson other pc?
one solution compress ~/scripts 1 file, bundle, copy other pc , clone git bundle.
seems easier (as quick win) trying launch listener on other pc (git daemon, sshd, httpd) in order git push 1 pc other: copy 1 file.
Comments
Post a Comment