简体   繁体   中英

Updating git bare repo from origin (without losing changes)

I'm setting up a git repo on my server for my work with contiki.

It should be accessible from multiple machines so I made a bare clone from the contiki repo, created a new branch and commited my changes.

Now I'm trying to update my repo with the new commits from the contiki repo and rebase my branch on them, but git tells me "pull" would only work in a work tree. "fetch" on the other hand just creates a new "FETCH_HEAD" file.

What do I do? Would a mirror-repo do the job? (But I don't want to publish my branch, just receive updates)

You need a working tree to do a pull in case it introduces conflicts you need to resolve. Just pull into any clone with a working tree, do what you need to do, then push to your bare clone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM