Updating edited source code
by Alpha-Kand · in Torque 2D Beginner · 02/09/2013 (6:37 pm) · 10 replies
GitHub help doesn't make this process very clear. BTW I have GitHub and VS c++ working fine.
How do I easily/clearly find new updates I can pull and update my source code? Say I make an edit to file X. Somebody comes out with an update for file X and puts in in the official repository on GitHub. I want to copy my edits to the new updated file manually and without GitHub automatically overwriting my edited file X. In the end I want to have the 'official' updated file X with my previous edits.
Having GitHub 'sync' might download the edits but I want to handle the files manually because I don't want a bunch of unused branches and forks and other cruft that I might easily lose control of in my inexperienced hands.
I'm not sure where to look for my answers other than here. All I can find is two-way updating.
How do I easily/clearly find new updates I can pull and update my source code? Say I make an edit to file X. Somebody comes out with an update for file X and puts in in the official repository on GitHub. I want to copy my edits to the new updated file manually and without GitHub automatically overwriting my edited file X. In the end I want to have the 'official' updated file X with my previous edits.
Having GitHub 'sync' might download the edits but I want to handle the files manually because I don't want a bunch of unused branches and forks and other cruft that I might easily lose control of in my inexperienced hands.
I'm not sure where to look for my answers other than here. All I can find is two-way updating.
About the author
I have always loved video games and computer games so decided to try making my own. Spent a little more than a year on a program simply named Game Maker which really got me interested. Finally decided to get "professional" by getting Torque 2D.
#2
02/09/2013 (10:59 pm)
SmartGit eh? At a quick look it seems promising but I don't want to spend money on it at this time since it has a trial period. I don't think I would be getting much out of my money for what I am doing so I'll just have to copy my edited files and let GitHub update them then blend them back in like you said.
#3
02/10/2013 (7:12 am)
SmartGit is amazing and well worth the money. It's what we use internally at GarageGames as our client. It handles merging of pulls with your changes beautifully. The interface is very user-friendly and it is the fastest client I have used, next to a command line. I have yet to encounter a conflict I couldn't easily resolve using it.
#4
I'm going to generally agree with Mich as to its general ease of use, but I actually still prefer SVN....
02/10/2013 (7:18 am)
You don't have to spend money - download the non-commercial version. If you start using it for commercial projects then buy a license.I'm going to generally agree with Mich as to its general ease of use, but I actually still prefer SVN....
#5
I approve.
Thank you both for the advice!
02/10/2013 (10:55 am)
I didn't know about the non-commercial version. I figured it was an either or setup because of the lack of honesty in this world. I just downloaded it and set it up and it looks more professional than the default GitHub program for sure. I approve.
Thank you both for the advice!
#6
Setup your git repo locally. Setup the origin as read-only from the official repo, or setup a remote repo to wherever you want. When you want to bring down new changes or updates, just merge the origin/remote branch into your local branch. All done.
If you're working on some edits, and don't want to commit it before merging, just stash your local changes first. If the merge screwed up anything (highly unlikely), you can always fix it from a previous commit or your stash.
You can do all of that from the git command line (the power shell version is what I use), or most 3rd party UIs will support that basic functionality as well.
If there are other Torque2D repo branches out there that you want to merge features in (in case the official doesn't pick it up), just set that up as a remote branch and then you can merge it like any other branch merge operation.
02/19/2013 (6:45 pm)
I'm not sure I see your issue? Setup your git repo locally. Setup the origin as read-only from the official repo, or setup a remote repo to wherever you want. When you want to bring down new changes or updates, just merge the origin/remote branch into your local branch. All done.
If you're working on some edits, and don't want to commit it before merging, just stash your local changes first. If the merge screwed up anything (highly unlikely), you can always fix it from a previous commit or your stash.
You can do all of that from the git command line (the power shell version is what I use), or most 3rd party UIs will support that basic functionality as well.
If there are other Torque2D repo branches out there that you want to merge features in (in case the official doesn't pick it up), just set that up as a remote branch and then you can merge it like any other branch merge operation.
#7
I couldn't find any easy to read docs on github in general. As soon as they started talking about command lines they lost me.
I didn't want to go that deep for me to just copy files from github to my computer so I could do stuff with them but I guess that's how it all works in the end.
02/20/2013 (8:09 pm)
I think I have it set up fairly good now. Github now pulls and rebases automatically when I tell it too. I haven't made any edits that the general updates don't cover e.g. fixes and the like. I couldn't find any easy to read docs on github in general. As soon as they started talking about command lines they lost me.
I didn't want to go that deep for me to just copy files from github to my computer so I could do stuff with them but I guess that's how it all works in the end.
#8
Fortunately, unless you're directly meddling with engine source files or modifying an existing module instead of a copy you shouldn't need to worry too much about stashing and merging.
Command line is your friend. He's that grouchy friend who you turn to when you have to do something and all of your prissy windowed friends are too pretty to get their hair mussed. He's the friend you want with you in a bar room brawl. For decades the command line has had our backs, man - learn it, work it, love it.
02/21/2013 (7:24 am)
It's probably a good idea for you to start gradually becoming more familiar with Git (and version control concepts in general) because you'll need that knowledge to work in a "live" codebase. Since T2D is now open source there will be relatively frequent changes when compared to the older distribution method and you will need to understand how to merge those changes with your own.Fortunately, unless you're directly meddling with engine source files or modifying an existing module instead of a copy you shouldn't need to worry too much about stashing and merging.
Command line is your friend. He's that grouchy friend who you turn to when you have to do something and all of your prissy windowed friends are too pretty to get their hair mussed. He's the friend you want with you in a bar room brawl. For decades the command line has had our backs, man - learn it, work it, love it.
#9
02/21/2013 (11:23 am)
If you are using a mac, SourceTree is a great free git interface. There's a beta for windows, I hope it will get released soon.
#10
If you want to pull in that feature branch you will need to understand how merging works.
02/22/2013 (12:50 pm)
It becomes even more important if you see some cool engine feature that someone has in their github repo, but is not part of the mainline code. If you want to pull in that feature branch you will need to understand how merging works.
Torque Owner Richard Ranft
Roostertail Games