U-disk as Git repository, complete code synchronization in different places

Source: Internet
Author: User

Refer to an online article "to build git repository on a USB stick"

1. I often have such needs, work, home need to the same code or document editing, and want to be synchronized in different places;

If the privacy is not so strong, you can directly use the GitHub escrow ha, of course, pay is also private ~ ~

2. First create a repository name on the USB flash drive: Git_mycbb_repos

git init–bare git_mycbb_repos//Bare library, no work directory

3. Re-build a source project name: GIT_MYCBB

Git init GIT_MYCBB

Put files that need to be managed synchronously

git Add. Add files, and if there are files that you do not need to manage, join the. gitignore file;

Git commit-m "initialized." Submit to local Warehouse

git remote add myusb f:/git_mycbb_repos//Adding Git_mycbb_repos on the U-disk as a remote repository

git push Myusb Master

4. Another computer or other place, insert the U-disk

GIT init mygittest//Build a local repository

git remote add myusb f:/git_mycbb_repos//Adding Git_mycbb_repos on the U-disk as a remote repository

Git pull Myusb master//complete code synchronization

U-disk as Git repository, complete code synchronization in different places

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.