How to set up a group GitLab repository and use Git
All team members need to have a gitlab(*) account on gitlab.cs.unh.edu. (If you can’t logon, contact support.)
- One team member creates a repository (Repositories -> New; initialize with a README and include a .gitignore)
- Invite your team mates as follows:
- Go to repository -> Settings -> Collaborators
- Under “Search by..” enter your team mates GitHub handle and invite.
- All team members need to check their email and confirm the invitation within 24h
Now all of you can clone the GitHub repository locally, commit, and push.
Here some Tips on working with Github
- Commit often
- Give informative commit messages
- first line is a summary,
- then empty line,
- then a list of everything that changed
- Make sure your code compiles before committing
- Pull often and merge changes
- If you are not ready to commit, but you want to pull, use:
- git stash
- git pull
- git stash pop
- You will have merge conflicts. Most of those are automatically handled by git. But you need to learn how to use a visual merge tool (e.g., meld, or one that is built into your IDE).
(*) if it says GitHub somewhere, I misspoke and meant to say gitlab.