User Tag List

View Poll Results: Do you like this plugin?

Voters
26. You may not vote on this poll
  • Good idea, good plugin!

    24 92.31%
  • No, i don't like it.

    0 0%
  • Meh, not sure.

    2 7.69%
Results 1 to 7 of 7

Thread: GitPush - Push your commits directly through the editor

  1. #1
    1

    GitPush - Push your commits directly through the editor

    Hello everyone!
    I made an plugin for our loved Unreal Engine 4 Editor. As some of you know, Unreal has great Source control features, and in the 4.9 release, they added Git source control support (which is still beta, but works fine!). So, with that, adding and commiting assets works pretty fine, but to push the commits onto your preferred Git server, you need to use the normal Windows cmd / some other Git GUI tools. I thought it would be better to have the functionality ready-to-use in the UnrealEd. So I made a plugin for that! Let's call it GitPush.
    However, this needs some things you need to know first:
    • You obviously need a git.exe binary, but I bet you have that already
    • The path to this binary needs to be in Windows' PATH environment variable (A simple test to see if thats working is to open up a new cmd and type in 'git'. If it shows you help on the command, everything is fine, if not, you need to put the path to git.exe in the environment variable (simple explanation below!))
    • Your projects needs to have a git repo already set up (if not the plugin shows you hints just FYI)
    • The plugin only supports Git connections via SSH, but that shouldn't be a problem
    • If you change something to the git information (e.g. creating / changing branches, adding / removing remote hosts) you need to restart the editor so GitPush recognizes the changes


    If you have a repo set up, with a master branch and remote server, you can use GitPush! Once in the editor, just click on the new button in the Viewport Toolbar. From there, go to the branch you want to push to, and then the remote host server you want to push to. (Note: Unreals Source control feature commits things on the master branch, however, if you select another branch to push to, it just copies the commit from the master to the selected branch).

    A simple workthrough on how to create and initialize the Git connection between a service (in this case GitHub) and Unreal:

    1. Make sure you have a SSH-key linked to your computer with your GitHub profile (click here for more information)
    2. Make also sure that you enabled Source control in the engine and filled out the nessecary information (more info)
    3. Create a new repo at GitHub
    4. Copy the SSH adress by choosing "SSH" in the drop-down above the file list (should read "HTTPS" before)
    5. In your project folder, open up a new command prompt window and type in git init. This initializes the project folder to be a local git folder.
    6. Pull all files from your created Git repo (should be empty, maybe it contains a README.MD) with git pull yourCopiedSSHadress. When you did step 1 right, it should download files from the repo your local folder should now contain the files from the repo + all your Unreal files.
    7. You can test whether git sees all new files by typing in git status. This should show you all files which are not in the repo (so all your Unreal project files).
    8. Now, you have the repo in your folder (the important part is the .git folder in your project folder), and my plugin sees the branch "master", because thats the default one, but it will tell you that you don't have any remote host. The remote host is the server you upload new changes to, and thats obviously GitHub aswell.
    9. Back in the command prompt, type in git remote add someName yourCopiedSSHadress. In most cases we use "origin" as the remote name and this remote host will be the repo's SSH adress.
    10. This shouldn't return anything.. You can check if the host is there by using git remote. This should list you the host you created.
    11. Now, just (re)start the Editor and hit the GitPush button. You should now see the master branch in the dropdown, and when you select that you should see the remote host's name. Clicking the hostname will then push files to the repo, if there are files to push, obviously.


    Download (tested 4.10.4):
    Click here
    Source code: Click here

    Some images:
    Spoiler: 






    If you have questions, bugs, or anything else, feel free to comment them here
    I hoped I helped some devs to do their work more efficient

    Have a nice day ❤

  2. #2
    0
    Wow amazing ;D Nice job!

  3. #3
    0
    Quote Originally Posted by DropMotion View Post
    Wow amazing ;D Nice job!
    Thanks for feedback!

  4. #4
    1
    Luminary
    Join Date
    Mar 2014
    Posts
    1,669
    This will make git commit and pushing in life or death situations much better



    Looks awesome

  5. #5
    0
    Nice, this feature is awesome, I will definitely try this!

    For long term, I would prefer to extend the official Source Control Provider of the Engine, but I didn't find the time for this before, so this is very welcome

  6. #6
    0
    Quote Originally Posted by SRombauts View Post
    Nice, this feature is awesome, I will definitely try this!

    For long term, I would prefer to extend the official Source Control Provider of the Engine, but I didn't find the time for this before, so this is very welcome
    Wow you were the guy who brought Git inside UE4 When I started, it was planned for a PR for the engine, but I hadn't the time to toy around with the github version here, so If you have, feel free to use my code, because I think it's nothing which you couldn't have done...

  7. #7
    0
    Quote Originally Posted by iUltimateLP View Post
    feel free to use my code, because I think it's nothing which you couldn't have done...
    It is often the case that we have a lot of idea, could make them realities, but just lack the time or the energy.
    I will try to take that time at some point in the future

Tags for this Thread

Posting Permissions

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