Setting up Git:
--globaloption to configure user name, email, editor, etc.
Creating a repository:
git initto initialize a repo. Git stores all of its repo data in the
git statusshows the status of the repo
File are stored in the project’s working directory (which users see)
The staging area (where the next commit is being built)
local repo is where commits are permanently recorded
git addput files in the staging area
git commitsaves the staged content as a new commit in the local repo.
git commit -m "your own message"to give a messages for the purpose of your commit.
git diffshows differences between commits
git checkoutrecovers old version of fields
git checkout HEADto go to the last commit
git checkout <unique ID of your commit>to go to such commit
.gitignorefile tells Git what files to ignore
cat . gitignore *.dat results/ignore files ending with “dat” and folder “results”.
Remotes in GitHub
A local git repo can be connected to one or more remote repos.
Use the HTTPS protocol to connect to remote repos
git pushcopies changes from a local repo to a remote repo
git pullcopies changes from a remote repo to a local repo
git clonecopies remote repo to create a local repo with a remote called
originautomatically set up
git check - b <new-branch-name
git checkout masterto switch to master branch.
occur when 2 or more people change the same lines of the same file
the version control system does not allow to overwrite each other’s changes blindly, but highlights conflicts so that they can be resolved.
People who incorporate General Public License (GPL’d) software into their won software must make their software also open under the GPL license; most other open licenses do not require this.
The Creative Commons family of licenses allow people to mix and match requirements and restrictions on attribution, creation of derivative works, further sharing and commercialization.
- Add a CITATION file to a repo to explain how you want others to cite your work.
- Rules regarding intellectual property and storage of sensitive info apply no matter where code and data are hosted.