First let me begin by saying what I want to do, then what seems not to work.
I have a project A, it sits in /local/projects/A
.
I want to copy the git repository over to another directory /local/backup/A
.
I also want to copy the git repo to /local/sandbox/A/aspect1
, /local/sandbox/A/aspect2
...
I want the copy to be complete.
By that I mean that if /local/projects/A
gets accidentally deleted, I want to be able to take /local/backup/A
( or one of the other copies ) and copy it back to /local/projects/A
and be able to continue ( after adding any pushes that happened since the last backup ) as though nothing happened.
Preferably I use git to do this rather then cp
/rsync
/generic
copying program.
Now what I've been doing that hasn't worked.
I cd into /local/backup/A
and do a:
git clone /local/project/A.
The problem is that I have two branches in my test project: master
and b1
. After cloning into /local/backup/A
and doing git branch
I see only one branch b1
.
So how do I make sure that I copy everything that is in the original?
One fear I have is to have a process where it looks like I've got everything ( say both branches ) and then when it's too late, I discover that I've missed copying something.
I've seen some articles on the net, but it seems like they focus more on the copying remote repositories not local repositories and I get confused by some stuff in those descriptions.