Monday, December 30, 2013

Publish local git repository on mac for backup

Unlike other source management system, commit in git only saves the change in your local box before pushing the change into remote repository. If your local box stops working, you will lose all you committed work in git.

To avoid happening, before you are ready to push the local git repository's change into remote git repository, you can publish your local git repository using git daemon, and then backup it in another git repository on another box.

Steps to publish a local git repository on mac:
cd YourGitFolder
git daemon --base-path=. --export-all --enable=receive-pack --reuseaddr --informative-errors --verbose

From a different box, run the below clone commands to get the repository
git clone git://FirstBoxIPAddress/

Note client can’t push into the change into the server's active git branch. Before pushing, user on the server should change to another branch.

By the way, the following command can be used to monitor the commit history for all branch
gitk --all
to avoid block the terminal app, append & at the end
gitk --all &




3 comments:

  1. Your blogs are great. Are you also searching for nursing capstone writing project? we are the best solution for you. We are best known for delivering quality nursing capstone writing services to students without having to break the bank

    ReplyDelete
  2. Good blog. Keep sharing. I love them Are you also searching for ajman assignment help? we are the best solution for you. We are best known for delivering writing services to students without having to break the bank

    ReplyDelete
  3. Experience heightened passion with Monster Rabbit, offering exclusive sex honey in abu dhabi. Our premium blend enhances intimacy, ensuring satisfaction and vitality. Ignite desire with Monster Rabbit's distinctive sex honey in Abu Dhabi for an unparalleled experience.

    ReplyDelete