简体   繁体   中英

git beginner question:how to sync local copy of repository under virtual environment and if previously have not set origin?

I'm a beginner to git and also many other stuff in code.

I am using a package from a collaboration git account and running it on a computer cluster. Recently some changes have been made to the package so I want to sync my local version to the collaboration one.

The package is installed and run under virtual environment called "dev". So each time I need to activate it with

source dev/bin/activate.

And I think when I was installing the package, I used some dumb way of literally downloading the entire package from the github collaboration account and copy/paste/installed it locally. So I didn't set any origin or upstream yet. Therefore the local one in some sense is independent from my fork or collaboration package (although exactly same as my fork).

After reading the article Syncing a Fork by Github, I have some questions:

1.Is the link's instruction of syncing fork still doable, since at the beginning I installed the package independently? (I was very afraid that if I used command "clone" or "fetch" in terminal, it will just download a complete new package instead of only making some small changes)

2. Should I do the sync under the path of

/home/accountname/

or

/home/accountname/dev/ 

or

/home/accountname/dev/packagename/

To be sure to not break anything, you can simply clone the collaboration repo locally in a new folder (different from the one you are currently working on).
If you know you don't have the right to push back to it (because you are not the owner or a collaborator on that remote GitHub repo), fork it first, then clone the fork (again in a new folder)

If you had made any changes of your own before, you can report them on the new local clone with:

cd /path/to/new/clone
git --work-tree=/path/to/old/local/copy add -p .

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