GitLab not able to sync fork - gitlab

I recently installed GitLab, however, I can't figure out how to use forks properly. I have the following versions installed:
GitLab 7.7.1
GitLab Shell 2.4.1
GitLab API v3
Ruby 2.1.4p265
Rails 4.1.1
I have found out the URL for forks (by creating another user and adding it to the project, but it doesn't show up in the GUI on own projects, link http://server.com/<user>/<repo>/fork/new works though), and once a fork has been made, it is not possible to sync the fork. At least, there's nothing I can find on Google nor the documentation for GitLab, but it is mentioned in changelogs at places or issues that apparently have been accepted (can't find the source anymore though).
Can anyone explain me how forking works and how I can sync the fork once the original repository has been updated?

how I can sync the fork once the original repository has been updated?
Simply by adding a remote reference to the original repo: see "Pull new updates from original Github repository into forked Github repository".
The opposite (from fork to original repo) is done using merge request: see "GitLab Flow"

Related

Node.js update via GitHub

So I am currently using node.js to make a Discord bot. I am switching the way things work however. The bot runs from my machine (computer), but I would like my friends to be able to work on it as well. Is there any way we can clone a GitHub repo into an existing folder, as to update the current BOT.js file we have?
The point of this is to have the bot auto update via github
You can create an empty Github repository, make sure to create it without any readme etc before you have made your first push.
Then using git, you initialize a git repo inside your current folder you are working out of, when you have done that, you can set a upstream to Github (w/ the repository URL you got for your newly created repository (on Github)), then just commit your files, push them to the Github repo master branch and you should be good to go.
Hope that helps!

Get latest release using nodegit

How can I get the code from latest release of a Github repository using nodegit?
I went through this API guide. I also look around in nodegit user guides. There are examples to get the latest commit - but not the latest release.
Note: I would like to use nodegit instead of github's api because I would like to make my code work with an internal git repository at a later point in time.
This is what I ended up doing:
Git clone to a common location, if this is the first time I am executing. Example from nodegit.
Git fetch on the location, for subsequent runs.
Once the repository is cloned to local machine, we can get the latest release from there to whichever work-space directory that we need it at.

Gitlab repository vs project vs submodule

I started exploring Gitlab for version control management and I got an issue at the first step itsself. When ever I create a project its creating a new repository. I have few webapplications which are independent to each other. In that case do I need to use different repository for every project.
What I am looking for is what is what and when to use what but not able to find what is repository and what is project in gitlab website as well as through other sources as well.
Also I came across a term submodule, when can it be used. Can I create one global project and have all the webapplications as different submodules.
Can any one please help me in understanding the difference between those 3 and when to use what based on their intended way of usage. Also please help me by pointing to a good learning site where I can get the information of doing basic version control operations in gitlab.
Thanks.
Gitlab manages projects: a project has many features in addition of the Git repo it includes:
issues: powerful, but lightweight issue tracking system.
merge requests: you can review and discuss code before it is merged in the branch of your code.
wiki: separate system for documentation, built right into GitLab
snippets: Snippets are little bits of code or text.
So fear each repo you create, you get additional features in its associated project.
And you can manage users associated to that project.
See GitLab documentation for more.
The Git repo and Git submodule are pure Git notions.
In your case, a submodule might not be needed, unless you want a convenient way to remember the exact versions of different webapp repo, recorded in one parent repo.
But if that is the case, then yes, you can create one global project and have all the webapplications as different submodules.
Each of those submodules would have their own GitLab project (and Git repo).

It is safe to push to gitlab repositories directly, from outside gitlab?

It is ok to push to gitlab repositories directly, from outside gitlab?
Mainly what I would like to know is:
* would gitlab detect changes?
* is is safe, as in if it will not break repos due to concurrency?
If I understand your question correctly you're asking whether it is possible to push commits from another git client than Gitlab to a Gitlab instance.
There's no problem at all concerning this, actually this is exactly what git and Gitlab is about.
It doesn't matter at all which Git client you use to get your commits done and pushed to the server running Gitlab. Think of Gitlab as just one possible frontend to your repositories.
If you are interested in the technical background:
Git is completely file-based and doesn't rely on any kind of central server managing your repositories. All relevant data is stored in the .git subdirectory of your project. This enables the use of multiple clients with a single repository - for example git and Gitlab.
Gitlab internally uses the gem gitlab_git which itself uses the library rugged that provides Ruby bindings for libgit2. That library is also used in the implementation of other git clients, "including the GitHub.com site, in Plastic SCM and also powering Microsoft's Visual Studio tools for Git".
Regarding the handling of actual concurrency problems, have a look at this answer by kan. Correct permissions are handled via git hooks as was kindly pointed towards in this comment below by Ciro Santilli.

import entire GitLab Cloud project to new GitLab instance

I have some projects set up on GitLab Cloud, complete with issues, wiki pages, etc. I've recently set up an internally hosted gitlab instance. I'd like to bring these projects over from GitLab Cloud to the internal GitLab instance.
Bringing over the git repos seems easy enough (change the remote and push), but I don't see how to bring over the wikis and issues.
In general it seems like this isn't possible. (There's a GitLab Feedback for it here.)
However, the project wiki's seem to be their own git repos, which you can see on the Git Access tab. While that doesn't solve issues/snippets, it gets you part of the way there.
I don't know how to transfer over issues as I have not had to do that yet, but passing over the wiki is not that difficult.
On your old gitlab instance you will notice two repositories for your project (let's pretend your wiki is oldproject), one will say something like oldproject.git and oldproject.wiki.git.
The general path to the repositories where you can see the names I am talking about (let's assume user-name is "myaccount") can be found here:
/home/git/repositories/myaccount/
or (if using the omnibus installer):
/var/opt/gitlab/git-data/repositories/myaccount/
I presume you already know how to transfer over oldproject.git. You do the exact same thing with the wiki, only you create a bundle file out of oldproject.wiki.git:
git clone http://gitlab-instance-ip/user-name/oldproject.wiki.git
cd oldproject.wiki
git bundle create oldproject-wiki.bundle --all
Now initialize your new project in gitlab...I presume you already know how to do that as you suggested in your question that you know how to import the files from your project over to the new instance without problem. Now repeat for the wiki:
git clone http://new-gitlab-ip/user-name/newproject.wiki.git
cd newproject.wiki
git pull /path/to/oldproject-wiki.bundle
git push -u origin master
I had a very similar problem to yours where I didn't see that anything was actually "pushed". When I went back to the gitlab project I noticed that it was in fact updated with the wiki. See here if you think it will help: Importing Gitlab Wiki to a new Gitlab Instance
Good luck!

Resources