Git commands
Jump to navigation
Jump to search
Github is a great place to host code, whether you use it to manage changes, post a final(-ish) version of code, or collaborate and share with others. It can be easier to use git than to email scripts, or point someone to a script on the supercomputer.
Starting a repo
First, you can create a directory (on any computer) and put some files into it. Then to initiate a repo, install git and run something like
git init
Then, to add all the files, run the following (to add specific files just run git add <filename>):
git add . ## to add all files
git add <filename> ## to add specific files
Finally, to commit the files to the repo, you can run commit
git commit -m "message about commit" ## to commit
git commit --dry-run -m "message about commit" ## to see what the commit will do first