git - Relink with a Github Repository on a New Machine -
i set github repository while ago: https://github.com/liambailey/tweetslider, code little jquery script pull recent tweets given user , display them in slider. have added few new features, , made jquery plugin. first version called tweetslider v1 , second called tweetslider v2.1.
first question: should add new version github, overwrite existing code new, or create fork new version?
if should create fork have found documentation , can manage that, if overwrite, have assumed should do, in spot of bother.
since creating repository have changed computers, , no longer have access local version of original repository. how can reconnect repository new local directory , delete existing files? once know how have found documentation recommit new files.
i hope can this.
the number 1 rule is: never develop without version control system :)
i don't know how did develop second version - have under version control in git repository? did based second version on top of commits of first version?
however, can add github remote repository (which answers "how can reconnect repository new local directory") in case local directory existing git repo (which can establish git init
command).
git remote add origin git@github.com:liambailey/tweetslider.git
and organization of repositories - depends if original version still makes sense use, if new version has backwards compatibility breaks etc.
if want have them separate repositories, go it.
if want replace old version new 1 in same repository, have options:
dirty way - "backup" old version branch , make commit new version in master.
git init -- copy new version directory-- git add . git commit git remote add origin git@github.com:liambailey/tweetslider.git git fetch origin git checkout origin/master -b v1 git push origin v1 git checkout master git push -f origin master
clean way - clone original repo , make logical steps did while developing second version - each of steps should separate commit. @ end should have new version nice history of commits.
git clone git@github.com:liambailey/tweetslider.git cd tweetslider -- make changes source code -- git add . git commit -- repeat until have second version -- git push origin master
Comments
Post a Comment