Android Question Having trouble using Github syncing across computers

netchicken

Active Member
Licensed User
Longtime User
We are using Github to work on a shared project. Its our first time working with GitHub. We have about 7 machines and the students are all building a single project.

We seem to be having numerous issues with Github and B4A.

eg: A new class was uploaded by a student and was synced to my local repository DataManager.bas yet that class doesn't show up when I run the program by reloading the program.

Another problem is that the files seem to be replacing, and not merging with each other. So the last person to upload overwrites the earlier work that has been uploaded.

Has anyone else had issues like this. Its stalled our work :)
 
Last edited:

netchicken

Active Member
Licensed User
Longtime User
In the .meta file there is a list of visible modules
VisibleModules=1,2
ModuleClosedNodes0=1,2
ModuleBookmarks0=
ModuleBreakpoints0=
ModuleClosedNodes1=
ModuleBookmarks1=
ModuleBreakpoints1=
ModuleClosedNodes2=
ModuleBookmarks2=
ModuleBreakpoints2=
SelectedBuild=0
UserTypesHint=Data,Card

How can we modify this for Github?

**Solved this issue here** just use Project/Add Existing Modules to add in the new modules

We still can't get the files to merge and not overwrite each other however
 
Last edited:
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
You should write one line at a time to the file, well that's what I would do anyway. Well I think that is what you're trying to do.
B4X:
Sub Activity_Create(FirstTime As Boolean)
    AddText("Add this line to the file")
End Sub

Sub AddText(Line As String)
    Dim TxtWriter As TextWriter
        TxtWriter.Initialize(File.OpenOutput(File.DirRootExternal, "TextFile.txt", True))
        TxtWriter.WriteLine(Line)
        TxtWriter.Close
End Sub
 
Upvote 0

netchicken

Active Member
Licensed User
Longtime User
Just an update, I found we are doing it wrong :) We should be creating branches of each feature we need and then merge those branches with the master file after its been passed by the other members in a Pull request. We are just all working on the master file. I hope this helps others.
:)
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
when there are conflicts it should give you the option to compare the conflicting files and select which lines your want to keep.

while this system can be a good thing it can be annoying aswell when several people work in the same file(s).
the best way seems to be creating a copy of your latest work, pull, apply changes and push it again (and hope noone else pushed aswell during that time)
 
Upvote 0
Top