Download

beginner on github

Hi all,

I have installed github desktop and created an account on github.com. I managed to create a github repository from my UE4 project on github desktop.
I have to publish it online to store this data, or is my commit data being stored on my hard drive ? (local repository)
If my project is corrupted, will i be able to get back to previous version (lastest commit) without publishing anything ?

Im working alone on this project so i dont need to share it with anyone.

Git is cool because the files are in two places…your local disk (repo) and on GitHub. So, if something whacky happens, you can do a pull from the orgin (GitHub)… Also, consider using SourceTree, its quite a bit nicer than GitHub desktop.

teak

Did you know that the Git Source Control Provider plugin integrated in the Editor is capable of initializing you UE4 project (“git init”) with appropriate .gitignore (and .gitattributes for LFS) in the Source Control Connect/Login screen :slight_smile: ?

You can work entirely in local, your “.git/” subdirectory will store all the history of your project. It is great to keep an online copy (or a remote stored on an external hard drive) but it is entirely optional.

Edit: if you stick with the most basic usage of Git, ie entirely local, the Git Plugin is able to do most of what you would ever need, from creating the initial local repository, to making commit, diffing assets through history…
You would still need a GUI (Github Desktop) or command line git only to create branch, push to a remote, or checkout an older commit.

Thanks mates,

Another thing, how can i create a new initial commit. Because once a month i save my whole project on a usb disk and at the same time i want to reinitialize github commits. I’d like to make a commit of the whole project, and add little commits everyday until the end of the month. How to do so please ?

Best and safest way would be to rename the “.git/” subdirectory in your project (for instance “save.git/”) then relaunch the UE Editor and re-“initialize the project with Git”.

Then you would have to “force” the push to Github so that it will erase the old history on the server.

For this:

  1. You need to unprotect the “master” branch on Github (it does not accept “force push” by default)
  2. Then, for instance on the commande line (some GUI like SmartGit can do this but only if allowed in the )

git push origin master --force

Thanks SRombauts.

Just before i do what you just said, i’d like to manage to include c++ edited files in my commits.

If i edit c++ file, then compile it in UE4, then if i click on “Source Control” > “Submit to source control”, the change list description doesn’t include the c++ file (only blueprints).

Here is my .gitignore file :

Binaries
DerivedDataCache
Intermediate
Saved
*.VC.db
*.opensdf
*.opendb
*.sdf
*.sln
*.suo
*.xcodeproj
*.xcworkspace

How to include c++ files in the commits please ?

Edit : here is the log

6.gif

Hi @guitou80, sorry but the Editor is not managing C++ files in source control (which is a shame) so the Git plugin is not able to present them in the “Submit Files” commit Window.

For now, you have to commit them by yourself, which limit the interest of integrated source control for C++ projects :frowning:

Thanks SRombauts

Hi just a side note. For anyone who is struggling with Github for Unreal Engine. Here is some cool things to know:

.You can handle all source control to github (including BPs) From Within Visual Studio!! Handles C++ obviously.

.The workflow is very simple. For things you need to install or setup: Visual Studio already handles that for you!

.If you make a change you can just press a button in VS and your files are Uploaded/Commited to github. Locally too.

Simple,Fast workflow. 2-4 minutes to setup.

If you need a tutorial or step by step guide you can check this out :