Jump to content

Best way to work with T3D GitHub repository?


Mud-H

Recommended Posts

After a while using Git for various projects, I'm getting more confortable with it but I'm still not sure what's the best way to develop using the Torque3D repository. Since I have never work on a Git project with a team, I'm still confused about how to set an efficient Torque3D git system and I always end up starting from scracth with a new repo.

I'm not asking for a Git tutorial but more about how to use Git with Torque3D efficiently by allowing me to simply merge latest commit into my files without messing up with my changes.


So here how I'm setting up my fresh repository for a project which will have limited code changes.


First, I forked Torque3D on GitHub and cloned it to my PC. Next I created a new private repository on BitBucket. Now I want to use the private BitBucket one as default remote and I will use my GitHub fork to fetch Torque3D commits. (To get changes from a commit I should use Fetch and not Pull, right?)


In that case, should I not use a Torque3D fork and simply use the Torque3D official repository? I'm not 100% sure about how forks work but while typing this I think my private BitBucket repo will acted as a fork?


Now, how I proceed if I want to include changes from a Forked T3D repo? I add the Torque3D fork repository to my remote repository and Fetch the wanted branch into my default repository by creating a new branch? Then I can merge that branch into on of my work branches? What happen if I have modify the same files, it will ask me to resolve conflicts and should decided which to keep?


I'd really like to know how contributors to Torque3D use Git. Someday, I'd like to contribute but before I need to have an effective Git workflow established. I have never used Pull Request. How you manage your Git setup to create Pull Request, you put all the changes in a Branch and the diffs are used for the Pull Request?


Can experienced Git users post a simple description about how they use it to develop on Torque3D. I use mostly SourceTree but I'm starting to move to GitExtensions since I understand Git better..

Link to comment
Share on other sites

Ok. I think I was wrong to use a T3D fork as source for my private BitBucket repository and that I should simply add official T3D GitHub repo as a remote. My T3D Fork should only be used in case I'm planning to make a pull Request, right?


Now I want to add the ProjectManager to my files by using the git repo: https://github.com/GarageGames/Torque3D-ProjectManager . So, I should add it to my remote repository and fetch it so I can merge it to my files. Should I keep the files in a local branch or should I merge them into my development/master branch... (Should I Pull project manager into current branch or Checkout project manager branch?)


In general, do you work with many branches or try to keep them limited?

Link to comment
Share on other sites

With the Project Manager merging, I get 3 conflicts: .gitignore, .gitattributes and readme.MD. I should resolve the conflict, by keeping my files in that case, right?



Hmm, now I'm confused again. I shouldn't merge the Project Manager repo into my build, right? It should be kept alone and I simply add the compiled files to my repo? So I'm reverting my merge/commit and will simply clone the Project Manager to a seperate folder to compile it. (I have always used the pre-compiled version of Project Manager before.


(Sorry to post a lot about my Git setup but that way, you can easily tell me what I did wrong...)

Link to comment
Share on other sites

I don't have a lot of time right now, but I'll address this:

 

How I can use a Git repo for my projects inside my T3D repo folder?

 

You can just create a new git repository in a project's directory. Here's an example. I can clone that repository right into My Projects/ and it has the correct structure for a project. If you want to tie your project's version to the version of the engine repository, you can use git submodules to do that. Here's an example in T2D - in the modules/ directory you can see a bunch of submodules that are used by the main game repo.

Link to comment
Share on other sites

  • 1 month later...

Apologies for bumping this but I have the same questions as Mud-H. I'm still fairly new to git, so if someone with more experience could chime in I'd appreciate it.


Let's say I have a project and I want to use the the latest 'master' release of T3D (3.6.3). I'm going to need to modify the engine source for this project but I -don't- want those changes being made public.


To do the above, I need to fork from GarageGames/Torque3D and add an 'upstream' link back to GarageGames/Torque3D. I'll make any of my changes to my local (on hard drive) copy of the engine but -won't- push those changes out to my fork at github.com.


Am I correct on the basics of git usage?


Let's say I want to update my engine to 3.7 when it's released. How should I handle that?


What if I want to bring in changes from another user's fork?

Link to comment
Share on other sites

What you are trying to do is not that hard, fork Torque3D, clone to your local, make your changes, commit your changes into your own branch and when the next version of Torque3D comes out, test it and when it works, merge it into your branch.

Link to comment
Share on other sites

Duinon's right - you should make all your changes in a separate branch, so that if we update 'master' or 'development', you can pull those changes into your copy of those branches, and inspect them without merging them into your own working branch. You could even create a private GitHub or BitBucket repo where you push your private branch.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...