As a open source project, there must be a LICENSE file to claim the rights.
Here are two examples of using Apache License, Version 2.0 and MIT licenses.
This license requires to put following content at the beginning of every file:
// Copyright [yyyy] [name of copyright owner]
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
Replace [yyyy]
with the year of creation of the file. Then use personal name for personal project, or organization name for team project to replace [name of copyright owner]
.
This license requires to put following content at the beginning of every file:
// Copyright [yyyy] [name of copyright owner]. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
Replace [yyyy]
with the year of creation of the file.
-
Other types of license can follow the template of above two examples.
-
If a file has been modified by different individuals/organizations, and two licenses are compatiable, then change the first line to multiple lines and make them in the order of time:
// Copyright 2011 Gary Burd // Copyright 2013 Unknwon
-
Spefify which license is used for the project in the README file:
## License This project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.