• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help using GIT

drakylucas

Intermediate OT User
Joined
Dec 15, 2015
Messages
236
Solutions
7
Reaction score
121
Can someone explains me how to use GIT in some situations?
I have my custom repository at bitbucket with my server (with few modifications on sources, lua, etc), and I want to get all the latests updates from TFS repository (on github).

What exactly I need to do in order to apply the recent updates automatically?


I don't know much about git :c
I have few different things in my sources, (but I used TFS as base, so the only modification I have, I made by myself), so I think I wouldn't have any problem with the difference in the code.
 
This covers anything about git

Git - Getting Started

Usually the most common command you use are

Code:
git commit -m "Message --all
Code:
git push

But git is very big and there a lot of commands (like branchs for examples) so just follow the getting started section of the git website.

Usually you fork a project (tfs) you can rebase to get the latest TFS commits while keeping your changes
 
This covers anything about git

Git - Getting Started

Usually the most common command you use are

Code:
git commit -m "Message --all
Code:
git push

But git is very big and there a lot of commands (like branchs for examples) so just follow the getting started section of the git website.

Usually you fork a project (tfs) you can rebase to get the latest TFS commits while keeping your changes

Thank you. I'll take a look into it.

Usually, I'm doing only basic things (as you said)
Code:
// first time
git status
git init
git remote add origin https://[email protected]/myaccount/mygit.git
git add . // at this time, I had all files of TFS in the current gitbash folder
git commit -a -m "Message here"
git push origin master // put my code on bitbucket

// all times
git status
git add .
git commit -a -m "message"
git push origin master

// to get code from Origin (remote):
git pull

to get the current TFS modification on my custom repository, I tried this:

Code:
git remote add parent https://github.com/otland/forgottenserver.git
git pull parent master

and I got this error:
Code:
 * branch              master     -> FETCH_HEAD
fatal: refusing to merge unrelated histories

then I did this:
Code:
git pull --allow-unrelated-histories parent master

and, with some effort fixing the HEAD in my code, it was finally updated.
now, when the TFS updates again, I'll need to redo all the Heads again? or the git is smart enough to keep what I already did and apply only the new differences?
 
Back
Top