Beginning a new repository using our model requires a central remote repository for the team members to contribute to.
To begin a new repository the following steps should be observed – note this assumes the default master branch is the name of your main development branch and that the remote will be called origin.
First create the remote repository on the network drive (i.e. Z:\sites\yourrepositoryname.git) , don’t forget the folder name should end .git, in windows command prompt – use the ‘cd’ command to navigate to this folder and run -
git --bare init
Then create your local repository (i.e. C:\User\Documents\yourrepositoryname) , cd to your folder and run -
You now have your remote repository ready to be linked.
Open SourceTree up and go to Clone/New in the top left corner, then choose add working copy and add the local repository (i.e. C:\User\Documents\yourrepositoryname).
After this step we add a sub-module that has our build files for jobs which is then committed to the history.
Once you have made your initial commit you can push your files up and associate this to the new remote by running -
git remote add origin [NETWORK PATH TO REMOTE].git
from your local repository by using ‘cd’ in the command prompt (i.e. C:\User\Documents\yourrepositoryname)
Finally push to this remote, the following command will automatically link your branch to the remote by running this script from your command terminal whilst in your local repository (i.e. C:\User\Documents\yourrepositoryname) -
git push -u origin master
You can then commit as usual and use push/pull to send, retrieve updates from the network server.
If you have done all the command prompts right you terminal should look along these lines…
After all these steps are made you can then open up NetBeans and create a new project file