- Create a mirror repo for sync
git clone --mirror[local_repo_name]
git remote add --mirror=fetch upstream
- Sync
git fetch --all -v --progress
git push --mirror -v --progress origin
- Auto Sync
Job done. Hope simple python script would come soon.
git clone --mirror[local_repo_name]
git remote add --mirror=fetch upstream
git fetch --all -v --progress
git push --mirror -v --progress origin
Since start using GIT as version control system, I use put all my
repos on BitBucket. I love the unlimited private repos from them. But
no command line tools for it is really painful for Linux users. Then I
start looking for good Python API for it to write simple script to
create/clone/list repos. But my Python knowledge make it a hard task
for me to do a good script.
Today just before I try to add "Description" to create repo, I found
the API "python-bitbucket-api" with Python script already. Try it out,
it is really good. Just some small issues like install and argument
parsing. Now everything works fine for me. Hope new features will
coming from original author(s).
If anyone is using BitBucket and looking for a command line tool for
it, you can give it a try: hg clone
https://enchanter@bitbucket.org/enchanter/python-bitbucket-api
http://foo.net/code/design/
|-- trunk/
| |-- proj1
| |-- proj2
|-- tags/
| |-- forProj1
| |-- forProj2
|-- branches/
| |-- forProj1
To create the tag:
$ git svn clone http://foo.net/code/design --trunk=trunk/proj1 --tags=tags/forProj1 --branches=branches/forProj1 localProjName$ git svn tag -n -m "test tag" test_v1Do the branch in the same way.
The original question and answer can check http://stackoverflow.com/questions/8306592/git-svn-how-to-create-a-tag-branch-for-a-sub-project-of-svn
$ git submodule update
fatal: reference is not a tree: ba81b5bf9ffce6b6ec9c50605035ca9dddb50023
Unable to checkout 'ba81b5bf9ffce6b6ec9c50605035ca9dddb50023' in submodule path 'Src/ThermalController' The cause of this issue is:foobar
- Trunk
- Branches
- Europe
- US
- Tags
- Version 3.11
- Version 3.12
If you use different conventions (like "trunk" instead of "Trunk"), take extra care to translate these in the code below. Our example Subversion project URL is svn://myserver/myrepo/foobar so you will need to translate this too.lisas = Lisa SimpsonFinally. make sure you have git and git-svn installed. Google to find out how to do this on your operating system.barts = Bart Simpson
git svn clone svn://myserver/myrepo/foobar --no-metadata -A authors.txt -b Branches -T Trunk -t Tags foobar_local
Make yourself some tea, coffee or martini - this will take a wee while, as it works through the entire history of changes in the Subversion project. Assuming all goes well, you should end up with a directory calledfoobar_local containing both your project, and more importantly a hidden directory called .git. To check, change into the directory and view the log:cd foobar_local
git log
git branch
That last command doesn't show your branches! Don't panic, this will come right later.cd foobar_local
git svn show-ignore -i trunk > .gitignore
git add .gitignore
git commit -m 'Convert svn:ignore properties to .gitignore.'
Note that Trunk in Subversion has been lower-cased by Git to trunk.cd ..
git init --bare foobar_bare
cd foobar_bare
git symbolic-ref HEAD refs/heads/trunk
cd ../foobar_local
git remote add bare ../foobar_bare
git config remote.bare.push 'refs/remotes/*:refs/heads/*'
git push bare
cd ../foobar_bare
git branch -m trunk master
After the push, Git will list the new branches. I told you not to panic! cd foobar_bare
git for-each-ref --format='%(refname)' refs/heads/tags |
cut -d / -f 4 |
while read ref
do
git tag "$ref" "refs/heads/tags/$ref";
git branch -D "tags/$ref";
done
git remote add origin https://myname@bitbucket.org/myname/foobar.git
git push origin master
git push origin europe
git push origin us
Your project is now on Bitbucket.cd ..
rm -rf foobar_local
rm -rf foobar_bare
And... you're done. Time for another tea, coffee, or martini to celebrate your success!