怎么把.repo缓存区的代码弄成本地的可读文件呢

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么把.repo缓存区的代码弄成本地的可读文件呢相关的知识,希望对你有一定的参考价值。

最近下载了一个百度云OS的coron源码,下载解压后,执行repo sync会更新已有代码,我不要更新这个,除了repo sync这个命令还有什么办法把.repo里面以前是下载好的代码给弄出来呢,比如.repo/project-objects/baidurom/devices-base.git这个文件夹用什么命令可以让他变成工作目录的devices/base文件夹呢

那是git库 ,你需要安装一个git就能对他读写和提取


git是纯命令的,你安装完git后再装个git的gui就容易多了。

这里是git的gui。

参考技术A repo sync -l 或者 repo sync --local-only
可将./repo直接本地析出而不用同服务器同步。
查看./repo/repo/subcmds/sync.py得到
p.add_option('-f', '--force-broken',
dest='force_broken', action='store_true',
help="continue sync even if a project fails to sync")
p.add_option('--force-sync',
dest='force_sync', action='store_true',
help="overwrite an existing git directory if it needs to "
"point to a different object directory. WARNING: this "
"may cause loss of data")
p.add_option('-l', ',
dest='local_only', action='store_true',
help="only update working tree, don't fetch")
p.add_option('-n', '--network-only',
dest='network_only', action='store_true',
help="fetch only, don't update working tree")
p.add_option('-d', '--detach',
dest='detach_head', action='store_true',
help='detach projects back to manifest revision')
p.add_option('-c', '--current-branch',
dest='current_branch_only', action='store_true',
help='fetch only current branch from server')
p.add_option('-q', '--quiet',
dest='quiet', action='store_true',
help='be more quiet')
p.add_option('-j', '--jobs',
dest='jobs', action='store', type='int',
help="projects to fetch simultaneously (default %d)" % self.jobs)
p.add_option('-m', '--manifest-name',
dest='manifest_name',
help='temporary manifest to use for this sync', metavar='NAME.xml')
p.add_option('--no-clone-bundle',
dest='no_clone_bundle', action='store_true',
help='disable use of /clone.bundle on HTTP/HTTPS')
p.add_option('-u', '--manifest-server-username', action='store',
dest='manifest_server_username',
help='username to authenticate with the manifest server')
p.add_option('-p', '--manifest-server-password', action='store',
dest='manifest_server_password',
help='password to authenticate with the manifest server')
p.add_option('--fetch-submodules',
dest='fetch_submodules', action='store_true',
help='fetch submodules from server')
p.add_option('--no-tags',
dest='no_tags', action='store_true',
help="don't fetch tags")
p.add_option('--optimized-fetch',
dest='optimized_fetch', action='store_true',
help='only fetch projects fixed to sha1 if revision does not exist locally')
p.add_option('--prune', dest='prune', action='store_true',
help='delete refs that no longer exist on the remote')
if show_smart:
p.add_option('-s', '--smart-sync',
dest='smart_sync', action='store_true',
help='smart sync using manifest from the latest known good build')
p.add_option('-t', '--smart-tag',
dest='smart_tag', action='store',
help='smart sync using manifest from a known tag')

g = p.add_option_group('repo Version options')
g.add_option('--no-repo-verify',
dest='no_repo_verify', action='store_true',
help='do not verify repo source code')
g.add_option('--repo-upgraded',
dest='repo_upgraded', action='store_true',
help=SUPPRESS_HELP)

以上是关于怎么把.repo缓存区的代码弄成本地的可读文件呢的主要内容,如果未能解决你的问题,请参考以下文章

Git学习

git中工作区,缓存区,本地库,远程库的简要区别

DevOps与Git之间的代码提取与上传

如何通过git把本地的代码上传到服务器

版本控制:git

git提交文件操作