You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dear MACS 30150 Perspectives on Computational Modeling for Economists students,
Here is a brief tutorial about how I want you to interact with this course through Git and GitHub. A good help is the Git and GitHub tutorial (git_tutorial.pdf) that I have posted in the Tutorials folder. Particularly valuable is Figure 3.2. But here is a summary of the steps. If you have gone far down an incorrect road, you can always "burn down" (delete) your fork and restart by following these directions.
Make sure Git is installed on your machine and set at least the user.name and user.email settings in git config as described in Section 3.2 of the tutorial.
For this main remote repository by clicking on the "Fork" button in the upper-right corner of the repository main page. This will create a remote copy of this main remote repository on your GitHub account in the cloud.
Clone your remote fork of this repository by going to the main page of your fork of the repository https://github.com/[YourGitHubHandle]/persp-model-econ_W20/, click on the green "Clone or download" button near the top right of the page, and copy the URL in the window to your clipboard. Then open a terminal window and navigate to the directory where you want to store this repository on your local machine. Type git clone [URL], where the URL in brackets is just the URL you copied from the "Clone or download" button (without the brackets).
In your terminal, change the directory to your new local Git repository by typing cd persp-model-econ_W20. You should see this folder in your hard drive file structure. If you type git remote -v you'll see that your local repository has a remote associated with it named origin, and that remote is your remote fork of the main repository.
Add another remote to be associated with your local repository. This remote will be the the main remote repository for the class (my repository). We'll call this remote upstream as opposed to your other remote named origin. In your browser, go to the main repository home page for the class (https://github.com/UC-MACSS/persp-model-econ_W20). Click on the "Clone or download" button near the top-right of the page. Copy the URL in that window to your clipboard. Then go back to your terminal and type the following: git remote add upstream [URL], where the URL in brackets is just the URL you copied from the "Clone or download" button (without the brackets). Now if you type git remote -v, you'll see that your local git repository on your computer has two remotes that you can draw from. The remote origin is your remote fork of that main repository that is on your GitHub account. The remote upstream is the main remote class repository.
If you want to download any updates to your fork both locally and remotely, you will type the following commands in your terminal once you have navigated to your repository folder. The first command pulls all the changed contain from the upstream main class repository and stages it to be incorporated into your local repo on your hard drive. The second command merges those changes into your local repository on your computer. The last command pushes those changes up to your remote fork of the main repository.
You can make changes to your fork of the repository locally on your computer. When you are done or at any point that you want to save your changes to your local Git repository and to your remote fork of the repository, you can type the following commands.
>>> git add [filename]
or
>>> git add [directory]/*
or
>>> git add -A
>>> git commit -m "[give short description of commit]"
>>> git push origin
These are just some instructions to get you started. I gave an 18-hour training on Git and GitHub research collaboration in September to advanced pre-doc students from around the country at NYU. All the slides, notes, notebooks, and problem sets for that training are publicly available in this repository (https://github.com/nyupredocs/githubtutorial). And I will be teaching a full course on this topic this Spring term.
The text was updated successfully, but these errors were encountered:
Dear MACS 30150 Perspectives on Computational Modeling for Economists students,
Here is a brief tutorial about how I want you to interact with this course through Git and GitHub. A good help is the Git and GitHub tutorial (
git_tutorial.pdf
) that I have posted in the Tutorials folder. Particularly valuable is Figure 3.2. But here is a summary of the steps. If you have gone far down an incorrect road, you can always "burn down" (delete) your fork and restart by following these directions.Git
is installed on your machine and set at least theuser.name
anduser.email
settings ingit config
as described in Section 3.2 of the tutorial.https://github.com/[YourGitHubHandle]/persp-model-econ_W20/
, click on the green "Clone or download" button near the top right of the page, and copy the URL in the window to your clipboard. Then open a terminal window and navigate to the directory where you want to store this repository on your local machine. Typegit clone [URL]
, where the URL in brackets is just the URL you copied from the "Clone or download" button (without the brackets).cd persp-model-econ_W20
. You should see this folder in your hard drive file structure. If you typegit remote -v
you'll see that your local repository has a remote associated with it namedorigin
, and that remote is your remote fork of the main repository.upstream
as opposed to your other remote namedorigin
. In your browser, go to the main repository home page for the class (https://github.com/UC-MACSS/persp-model-econ_W20). Click on the "Clone or download" button near the top-right of the page. Copy the URL in that window to your clipboard. Then go back to your terminal and type the following:git remote add upstream [URL]
, where the URL in brackets is just the URL you copied from the "Clone or download" button (without the brackets). Now if you typegit remote -v
, you'll see that your local git repository on your computer has two remotes that you can draw from. The remoteorigin
is your remote fork of that main repository that is on your GitHub account. The remoteupstream
is the main remote class repository.These are just some instructions to get you started. I gave an 18-hour training on Git and GitHub research collaboration in September to advanced pre-doc students from around the country at NYU. All the slides, notes, notebooks, and problem sets for that training are publicly available in this repository (https://github.com/nyupredocs/githubtutorial). And I will be teaching a full course on this topic this Spring term.
The text was updated successfully, but these errors were encountered: