Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
restrepo
GitHub Repository: restrepo/ComputationalMethods
Path: blob/master/material/Syncing_fork.ipynb
934 views
Kernel: Python 3

Open In Colab

GIT Usage

See "Guia sencilla"

In summary

  • Clone the repository with

git clone https://github.com/restrepo/ComputationalMethods.git

[1] After some time working with it, you may save the modified notebooks elsewhere. Then, discard your changes with

git stash

[2] Donwload the updated repository files with

git pull origin master

Go to [1] and [2] for further changes

Homework assignments management

There is an special repository to the evaluation of the course:

https://github.com/ComputationalMethods/Evaluacion_2021-1

Fisrt make a fork of the official repository in GitHub

  1. Inside the repository, you must create a folder with your identification number and go there. Example:

mkdir 98567894
  1. Copy your Tarea or Examen there, and rename the file, e.g old_name.ipynb by adding to the beggining either Tarea_NN_ or Examen_NN_, where NN is the number of the Tarea or Examen. Example:

mv old_name.ipynb Tarea_01_old_name.ipynb
  1. Add the file to cloned repository. Example:

git add Tarea_01_old_name.ipynb
  1. Commit the changes

git commit -am 'Tarea 1 sobre repaso de Python'
  1. Upload the changes to your forked repository

git push origin master
  1. Make a pull request from the GitHub web page of your forked repository. See here and here

Install JupyterLab and GIT in your android cellphone

See this help

Fork official repository

This notebook explains the recommended way to use this repository. If you only want to visualize the notebooks trough the viewer in GitHub, you can safely ignore this section.

  • First make a fork of the official repository in GitHub

  • Clone your own copy of the repository with

git clone https://github.com/usuario/ComputationalMethods.git

[1] After work some time working with the repository you would like to register your changes with

git commit -am 'My changes'

Or discard your changes with

git stash

[2] Check for possible changes before send your commit

git pull --rebase origin master

[3] Send changes to repository

git push origin master

[4] Go to [1] for further changes

Sync with official repository

  1. ONLY for the first time: Follow the instructions for LINUX in Configuring a remote for a fork

  2. After that, follow the instructions in Syncing a fork

Summary of commands Only the first time:

git remote add upstream https://github.com/restrepo/ComputationalMethods.git

And before each pull request:

ssh -XC user@hub.oproject.org #or use jupyter terminal cd ComputationalMethods git fetch upstream git checkout master git merge upstream/master

or just execute

syncurso

To update the forked repository in GitHub, just use or just execute

git push origin master
  1. After finish your work, save your changes as new notebook and to clean to the initial state use:

git stash

FAQ

  1. How to remove last commit from a remote git repository? If necessary make a clone of the broken repository

git reset HEAD^ # remove commit locally git push origin +HEAD # force-push the new HEAD commit