They have different webinterfaces but all work with git.
This tutorial uses GitHub.
We will start easy!
Note
Go to:
https://tinyurl.com/repcorecipes
Now that you have started to customise your new GitHub repository, let’s have a look whether we can do that in a bit more convenient way, directly on your computer instead of through the web browser.
Explore the Web interface!
Summary
In the next section we will create our own Git repository!
Git knows two ways of creating an own Git repository.
If you like to have a copy of an existing Git repository that someone else created, you create an own copy by “forking” the repository. This will create a copy of the repository under your GitHub account.
You can create your own GitHub code repository. Simply go to your account and click on the green button “New” under “Your Repositories”
Simple repository templates provided by Utrecht University
git status
git add README.md
git commit -m "Change the README file"
You can now push the content of your local repository to the one on GitHub:
git push
Congrats, you have made your first push and your scripts are online!
\___ THANK YOU!
Take a look at your online repository. - Who is the author of your commits? - If it is not you, you can configure git to use your identity (make sure GitHub knows this email address):
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
git status
git pull
.gitignore
Please note: are there (temporary) files you do not wish to track? Add them to the .gitignore file. Consider a .gitignore template for your language: examples on this github repo.
Run git log to see the history of your project.
Can you use Git and push to Github from your IDE?
Experiment with editing and committing on GitHub itself (e.g. add something to the README file). You can then ‘download’ your changes to your local repository using git pull.
Run git log again to see the history of your project.
Optional: What happens if you edit the same file online and locally, and try to push/pull? (Hint: this often causes a ‘merge conflict’, which is no fun to experience. Going through it today means we can assist you if necessary!)
git status
Git status shows you the status of your repository. It tells you which files are created, modified, or deleted relative to the last git snapshot (aka commit) of your project.
git diff
Git diff shows you the actual differences between the files that you have changed since the last snapshot.
git --help
This command will show you all the commands that you can use with git.
Workshop Computational Reproducibility