Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

ClassMaterial

Index


Git Guide

Useful links

Setting Up GitHub

> Install git

Installing git should be a simple apt-get / yum/ etc install.

> Clone remote repository

image

You can get web URL for repository just as above image.

  1. You can clone the current lab repository by issuing the following command on the command line:
# format
$ git clone [web URL]

# example
$ git clone https://github.com/SWE3003-41/ClassMaterial.git

If you get an error doing clone most likely the cause is that you just haven't finished setting up your Github account.

  1. Than change your working path to your newly cloned repository:
$ cd ClassMaterial

Getting Newly Released Commit

Once new commit version is released, pull in the changes from your local directory:

$ git pull origin master

Work on your own account

> Fork

!! In case of miniBase project fork repository and work on your own account!

image

Press Fork button to work on your own repository.

image

Than you can see forked repository on your own account.

> Configuring a remote for a fork

  1. Clone forked repository:
$ git clone https://github.com/[YOUR_USER_NAME]/[FORKED REPO].git
  1. List the current configured remote repository for your fork:
$ git remote -v
  origin htts://github.com/[YOUR_USER_NAME]/[FORKED REPO].git (fetch)
  origin htts://github.com/[YOUR_USER_NAME]/[FORKED REPO].git (push)
  1. Specify a new remote upstream repository that will be synced with the fort
$ git remote add upstream https://github.com/SWE3003-41/[ORIGINAL_REPO].git
  1. Verify the new upstream repository you've specified for your fork
$ git remote -v
  origin htts://github.com/[YOUR_USER_NAME]/[FORKED REPO].git (fetch)
  origin htts://github.com/[YOUR_USER_NAME]/[FORKED REPO].git (push)
  upstream htts://github.com/SWE3003-41/[ORIGINAL_REPO].git (fetch)
  upstream htts://github.com/SWE3003-41/[ORIGINAL_REPO].git (push)

> Syncing a fork

  1. Change the current working directory to your local project
  2. Fetch the branches and their respective commits from the upstream repo. Commits to master witll be stored in local brance, upstream/master.
$ git fetch upstream
> remote: Counting objects: 75, done.
> remote: Compressing objects: 100% (53/53), done.
> remote: Total 62 (delta 27), reused 44 (delta 9)
> Unpacking objects: 100% (62/62), done.
> From https://github.com/SWE3003-41/[ORIGINAL_REPO]
>  * [new branch]      master     -> upstream/master
  1. Check out your fork's local master branch
$ git checkout master
  Swithed to branch 'master'
  1. Merge the changes from upstream/master into your local master branch.
$ git merge upstream/master

About

git guide, assignment notification ... etc

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors