Results 1 to 15 of 15

Thread: It's a separate and more important source control question

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    It's a separate and more important source control question

    So I asked a question here which is still outstanding but now I have a more important question.

    I was working on laptop A using Visual Studio 2015 with a local repository for source control.
    I got a new laptop B where I installed Visual Studio 2019 and manually copied over all my source and started developing there. It doesn't know anything about my repository on A.
    How can I get my repository so I don't lose all my history?
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,274

    Re: It's a separate and more important source control question

    That depends on the source control system. You would have to install the same system on the new machine and then export from the old instance and import into the new instance. How exactly that export and import works depends on the system.

    By the way, this has exactly zero to do with C#. This is a general developer question so I have asked the mods to move the thread to the General Developer forum.

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: It's a separate and more important source control question

    Quote Originally Posted by jmcilhinney View Post
    By the way, this has exactly zero to do with C#. This is a general developer question so I have asked the mods to move the thread to the General Developer forum.
    Yes, that is what i had said in my first thread, yet no one redirected me. Thanks.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  4. #4
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,447

    Re: It's a separate and more important source control question

    Quote Originally Posted by MMock View Post
    So I asked a question here which is still outstanding but now I have a more important question.

    I was working on laptop A using Visual Studio 2015 with a local repository for source control.
    I got a new laptop B where I installed Visual Studio 2019 and manually copied over all my source and started developing there. It doesn't know anything about my repository on A.
    How can I get my repository so I don't lose all my history?
    If you are going to be using both machines then an easier approach might be to create an online repo and push from the original machine to the online one and then pull onto the second machine. That way you can use both and keep them in sync.

    This would also work as a way to migrate from the first to the second machine, once you have cloned the repo on the second machine there is no longer a need for the first one - this would also give you a cloud hosted repo you could sync with to prevent data loss if the laptop was damaged etc.

    If you are just wanting to copy the repo then Git stores all of the repo information in a hidden folder called .git - make sure you copy that folder along with the source if you want to copy the history as well.

  5. #5

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: It's a separate and more important source control question

    Yes, I see now that .git is the folder I overlooked. I hope (and maybe you can tell me) after that is done being copied, when I open VS it will find it and I'll have my history back?
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  6. #6
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,522

    Re: It's a separate and more important source control question

    Stop copying... start cloning...

    As PD mentioned, you should be synching your local repo with a remote one, and then when you move to a new computer, cloning the repo back down to that one... then pushing back up when done, so that you can then pull down to another to get those changes....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: It's a separate and more important source control question

    I know I have been using it wrong. After all, it was only local. Are there instructions online for exactly how to do this. I need a step by step translation of "Sync your local repo with a remote one", "clone the repo back down" , etc. Thanks.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  8. #8
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,447

    Re: It's a separate and more important source control question

    dev.azure.com is free for up to 5 users. If you create a project it will give you instructions on how to push your local repo up to it.

  9. #9

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: It's a separate and more important source control question

    Is there more to it than just this? https://tahoeninjas.blog/2018/11/17/...edrive-folder/
    Meaning, if I have my source/repos folder on the OneDrive and my .git folder is also there, my current version and my history are backed up and will always be accessible?
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  10. #10
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,447

    Re: It's a separate and more important source control question

    If you are storing your code in a git repo, you probably don't want to also have it on a one drive. Not entirely sure how well that would handle the various hidden files etc. that go into git.

  11. #11

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: It's a separate and more important source control question

    @PlausiblyDamp, thank you for taking the time to make sure I am doing this correctly!
    So tell me, am I misunderstanding the article I cited in post #9?
    In his first screenshot, he sets his Projects location: C:\Users\hugoa\OneDrive\Source
    In his second screenshot, he sets his Default Repository Location: C:\Users\hugoa\OneDrive\Source
    What exactly does that mean and where are all the git revisions kept?
    He refers us to this video which really just shows you (again) how to set Projects location and Default Repository Location (in case you want to be spoon fed, I guess).
    In the video, Andrew Grant doesn't use OneDrive, he uses his C drive. Doesn't that mean his source code revisions are all stored locally? This is what I am trying to get away from. Because when my local hard drive takes a hit, poof everything is gone. But no, I don't want to use OneDrive, if you are saying that won't function correctly.
    What I could do is set my Projects location to my OneDrive and the git repository to our network drive which is backed up, if that's what you recommend. And how I would do that is these same two screenshots?
    Thank you!
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  12. #12
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,522

    Re: It's a separate and more important source control question

    I wouldn't even entertain the idea of using OneDrive for project backups, except for the occasional zipped snapshot backup.
    As for git... right, so you should be committing as you go, which commits the changes to your local repo, then also on a regular basis, pushing those commits to a remote repo. This does 1) prevents loss in case your drive goes poof! and 2) you have a history of the changes in case you need to get back to an older version and 3) also makes it available else where when you login to Git.
    The reason you don't want to mix git and OneDrive is because git is going to create hidden folders... a lot of hidden folders that it will use to track those changes locally, your different branches, the revisions, etc. You really, really, really do not want that being replicated into OneDrive... it'll be constantly syncing, and then your computer will bog down with the constant changes happening. Not to mention the next system you login to with OneDrive will then try to bring down ALL those changes too... and (sip coffee) yeaaaah... you don't want that...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  13. #13
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: It's a separate and more important source control question

    I wouldn't even entertain the idea of using OneDrive for project backups, except for the occasional zipped snapshot backup.
    Yeah Git is your project backup, if you are using branches then each branch is basically a release when you commit your work up to Git it will keep a history of all your changes for that branch (and each branch)

    As techgnome said the idea is to push work up regularly, you break up work into smaller chunks and commit locally as you go, then say for example at the end of each day push your work up to Git.

    I personally commit and push up work more frequently than that, but then I am working in a team where it is more important that the other Dev's have your changes.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  14. #14

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    Driving a 2018 Mustang GT down Route 8
    Posts
    4,475

    Re: It's a separate and more important source control question

    Thank you.
    So I will revise the question I asked at the end of #11.
    What I could do is set my Projects location to my local drive (formerly I said OneDrive) and the git repository to our network drive which is backed up, if that's what you recommend. And how I would do that is these same two screenshots?
    I mostly understand what you are saying just not how to hands-on implement it; that is, get it all out to the network drive.
    Just so you know my environment, I am a team of one so no one else needs access to my code. I use a laptop and so far during the 5 years I've worked here have never needed to access my code from another device. But I did open this thread last year when I got a new laptop. I use revision history a lot to compare changes - if people say something used to work and now doesn't but isn't a result of one new revision but several later, or they say there used to be a command button and now it's gone (usually to prove there was never the button they think they are missing, LOL! Users!)
    So this shouldn't be too hard to get my code where it is safe and I can stop worrying.
    There are 10 kinds of people in this world. Those who understand binary, and those who don't.

  15. #15
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,447

    Re: It's a separate and more important source control question

    If you are using Git then your local working folder would also be a repository.

    You would then need some sort of remote Git server to push your changes to. There are several free options you could install or alternatively a fair few cloud hosted options that are also free.

    https://git-scm.com/book/en/v2 is definitely worth looking at, chapter 4 talks about a couple of options for a Git server.

    Recent versions of VS have a lot of the basic Git functionality built in so you rarely need to use the command line tools either.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width