简体   繁体   中英

Git: Copy Repo To New Directory To Continue Working

I've been working in directory v3 (ie master).

I am now in a new directory, v4.

While in v3, I created the branch v4.

How do I bring in the .git file from directory v3 into directory v4 and continue posting to the new branch?

I initially thought of cloning v3 into v4 but that clones all the source files as well. I don't need all that, just the .git file if possible.

You can easily make a new repo in v4 using git init. It's possible to merge these repos later..

Or if your v4 folder is already a git repo, do this from v3 folder:

git checkout v4
git pull ../v4 master # pulling branch master from repo in v4 directory

(or please refer to the docs of git pull if I'm wrong)

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