I want to try gitlab community edition in my fedora laptop. From the downloads page, it has binary packages for Ubuntu and CentOS 6 and CentOS 7. Which one should I be installing in fedora(release 21) or should I compile from source?
If it's just a package, you should be ok. It's generally not advised to install Fedora packages on CentOS because of the risk of unmet dependencies, since Fedora typically has more recent versions of libraries etc. This is less likely to be the case (but still possible) if you are installing a CentOS package on Fedora.
If on the other hand it's a package to install a new repository, check the file in /etc/yum.repos.d and see if it is calling something like "release version" as a variable. If it is, change it to explicitly track CentOS 7.
Hawing googled a bit, I noticed that the most common answers on your question are - "yes, you can, using the .rpm file for CentOS/EL7".
Following, for example this guide, you may really download package for CentOS 7 and use is.
If you'd like to find any alternative way, you may follow this page and search the best one for your usecase. For example, you may use Docker container that doesn't depend on any kind of software and libs on your host machine (instead of Docker itself, of course).