Source control is a system for tracking changes to files over time.
What's the point?
- No version hell
- Why did I do that?
- Satisfy auditors
- UNDO, UNDO, UNDO!!
What techs are there?
- Central systems like SVN
- Distributed systems like Git
- Hybrid systems like TFS
Why GitHub?
- Git is awesome
- Public / private models
- Great UX
- Great integrations
(@cthydng)
- Repository: Your project and it's history
- Remote: The (TFS/GitHub/VSO etc) server
- Clone:Take a linked copy of a repository
- Fork: Take an unlinked copy of a repository
- Pull: Update your copy of a repository
- Add: Include a file in a change
- Commit: Make the latest state of all the added files the new default state
- Push: Update the central copy of the repository with your commits
git config --global user.name "John Doe"
git config --global user.email [email protected]
- Tools > Version Control > Project Setup
- Select changed / new / deleted files to commit
- Hit "Commit"
- Add Short tile for change
- Hit Enter, and add details
- Hit commit
git init
git add somefile.R
git commit -m "Some message"
- Add git to a directory
- Commit some code
- Get a URL
- File > New Project > Version Control > Git
- C&P URL
- Go to GitHub and "Fork" lockedata/sampleProject
- Go to your copy and copy the "Clone with SSH" URL
- Clone the repo using the cmd line
- Create new repository in GitHub
- Get code for "existing repository"
- Open shell
- Copy & paste
- Use the GUI to commit code
- Hit Push!
- Create repo online for one of your projects
- With your code all committed, add the online repo
- Upload your code
Use the "pull" to get the latest copy of code online.
- Pull the latest copy of your code
Keep changes as small as possible to avoid loss and more pain later.
Before you push your changes always hit pull first!
Merge conflicts happen when multiple people have done something to the same lines at the same time and git doesn't know which one to pick.
Resolve by picking which bits you want. Commit and push!
<<<<<<< HEAD
I tried changing to this line
=======
And I tried changing to this line
>>>>>>> COMMITONREMOTE
to
And I tried changing to this line
- Alter a line on your README and commit it locally
- Alter the same line differently online and commit it
- Pull the changes
- Fix the merge conflict in your text editor / R
- Commit and push the fix