[← ppnm]

Exercise "Git/Mercurial"

Tasks

  1. Get yourself an account at one of the Distributed Version Control servers. Bitbucket, Github, and Gitlab (which run Git only) are popular choices with free plans. Sourceforge (which runs both Git and Mercurial) is another possibility. There is also a server at AU [gitlab.au.dk] but you will probably not be able to access it after graduation. Alternatively, any POSIX box with a static IP address running Apache and Git (like sdf.org) would do.

  2. Read about Git at Bitbucket[] (or any other place) and/or about Mercurial at mercurial-scm.org.

  3. Install Git or Mercurial at your box,

    sudo apt install git
    
    or
    sudo apt install mercurial
    
  4. At your server: create a new project with an indicative name like "ppnm" :). You might need to read your server's documentation about how you do this.

  5. At your box:

    1. Make a directory for your repositories,
      mkdir ~/repos
      
    2. Go to your directory,
      cd ~/repos
      
    3. Clone your repository from the server to this directory,
      git clone address-of-your-repository
      
      or, if you use mercurial
      hg clone address-of-your-repository
      
    4. Do your exercises in (subdirectories of) this directory, add new files, commit changes, and push the commit to the server,
      git add --all
      git commit --all --message 'did this and that blah blah...'
      git push
      
      or, if you use mercurial,
      hg add
      hg commit --message 'an indicative message describing commit'
      hg push
      
      The long options can be abbreviated as -a and -m.