0

We would like to move our git repository to an atlassian stash installation. I have created a new and empty repository in stash and from our existing git repository on my local machine I have executed:

git push stash-remote refs/remotes/origin/*:refs/heads/*

Where I have configured/added the stash-remote in the repository I am standing in. It shows up fine in the stash web interface.

Is that all I need to do to get a complete copy of our git repository into stash so our developer can continue working on the new stash repository?

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79
u123
  • 247
  • 7
  • 21

2 Answers2

1

After setting up a new stash repo, set the origin of your git repository on your local machine. your can get the url from stash as ssh://.. or http://...

git remote add origin http://<your stash repo url>

Then push your git repo to stash:

git push origin master

This pushes your entire master branch to stash, including all previous commits. To push all (committed) branches to stash use

git push origin --all
WeSee
  • 476
  • 1
  • 4
  • 10
1

What you want to do is mirror the repository before pushing:

$ git clone --mirror git@example.com/upstream-repository.git
$ cd upstream-repository.git
$ git push --mirror git@example.com/new-location.git

This will create a complete copy with all branches and history.

Martin K
  • 111
  • 4