I am new to git
and I am trying to learn some new stuff.
I want to know is it possible to have two branches which are independent of each other (no common ancestor) in the same repo.
Illustrative Example:
Let's imagine we have a repo stored in git@git.someDomain.com
. Under ~/git/
I have many directories (myDir1
, myDir2
, myDirN
...) holding code which I have obtained doing:
git clone git@git.someDomain.com:my-repo-1
git clone git@git.someDomain.com:my-repo-2
and so on...
Now I want to move ~/git/myDir1/scripts
to ~/scripts/
because I want to keep those scripts separate from the source code stored in ~/git/myDir1
I go to ~/scripts
and execute git init
thus I create a local repo for those scripts.
And there I get stuck.
Questions:
- How do I push this local repo to
git@git.someDomain.com:my-repo-1
? - How do I get the content of
~/scripts
(the newly pushed branch) in the~/someScripts
on my other PC?
I apologize beforehand if I have abused with the git terminology, I am still trying to learn what a branch, remote, origin etc. mean.