### Site Tools

analysis:nsb2019:week1

# Differences

This shows you the differences between two versions of the page.

 analysis:nsb2019:week1 [2019/06/27 07:26]amarek analysis:nsb2019:week1 [2019/06/30 16:12]mvdm Both sides previous revision Previous revision 2021/06/14 15:30 mvdm 2021/06/14 13:03 mvdm 2021/06/14 11:51 mvdm 2019/06/30 16:12 mvdm 2019/06/30 16:12 mvdm 2019/06/28 10:41 amarek 2019/06/27 07:27 amarek 2019/06/27 07:26 amarek 2019/06/27 07:26 amarek 2019/06/24 17:21 amarek created Next revision Previous revision 2021/06/14 15:30 mvdm 2021/06/14 13:03 mvdm 2021/06/14 11:51 mvdm 2019/06/30 16:12 mvdm 2019/06/30 16:12 mvdm 2019/06/28 10:41 amarek 2019/06/27 07:27 amarek 2019/06/27 07:26 amarek 2019/06/27 07:26 amarek 2019/06/24 17:21 amarek created Next revision Both sides next revision Line 32: Line 32: For now, you can use the module %%GitHub%% account, see the ''​README.txt''​ file on the share for the credentials. You're also welcome to use your own account; if you don't have one yet, go to [[http://​www.github.com|GitHub]] and sign up. E-mail me (mvdm at dartmouth dot edu) your account name, so I can give you write access to the code repository we will use. For now, you can use the module %%GitHub%% account, see the ''​README.txt''​ file on the share for the credentials. You're also welcome to use your own account; if you don't have one yet, go to [[http://​www.github.com|GitHub]] and sign up. E-mail me (mvdm at dartmouth dot edu) your account name, so I can give you write access to the code repository we will use. - Meanwhile, download and install the Git client of your choice if you don't already have one installed. This is a piece of software that will allow you to talk to %%GitHub%%, which is where the code is actually stored. For Windows, ​I recommend ​[[https://github-windows.s3.amazonaws.com/GitHubSetup.exe|GitHub Desktop for Windows]] as a user-friendly way to get started. For installing ​Git and setting up GitHub ​on various ​operating systems, see [[https://​help.github.com/​articles/​set-up-git|GitHub:​ Set Up Git]]. + Meanwhile, download and install the Git client of your choice if you don't already have one installed. This is a piece of software that will allow you to talk to %%GitHub%%, which is where the code is actually stored. For Windows, ​you can get git [[https://git-scm.com/download/​win ​| here]]. For more detailed info on different ​Git clients ​and setting up Git on other operating systems, see [[https://​help.github.com/​articles/​set-up-git|GitHub:​ Set Up Git]]. - + - Next, configure your client. For %%GitHub%% Windows, after starting up the %%GitHub%% %%GUI%% (the default window that opens when you run %%GitHub%%) you'll first need to sign in with your account, then click Tools > Options. Set the "​Default Storage Directory"​ to something reasonable such as ''​D:​\My_Documents\GitHub\''​). Also check that your username and e-mail address look ok (I am ''​mvdm''​). + === Cloning the module codebase === === Cloning the module codebase === - Now we are ready to use Git to create a local copy ("​clone"​) of the module codebase. ​If this is your first time using git, I recommend you open a Git Shell, which you can do by typing ''​Git Shell''​ in the search box of the Start menu. Once open, note your working directory (displayed at the prompt of your now opened shell) and type ''​git clone https://​github.com/​mvdm/​nsb2018'',​ which will create a new folder ''​nsb2019''​ in your working directory. + Now we are ready to use Git to create a local copy ("​clone"​) of the module codebase. ​On Windows, open a PowerShell, which you can do by typing ''​powershell''​ in the search box of the Start menu. Once open, note your working directory (displayed at the prompt of your now opened shell), and change it to a different location if you prefer, using the cd comamand. Once you are in an appropriate location, such as a new folder named ''​GitHub''​ on your local machine, ​type ''​git clone https://​github.com/​mvdm/​nsb2019'',​ which will create a new folder ''​nsb2019''​ in your working directory. - As an alternative,​ you can navigate to the course repository [[https://​github.com/​mvdm/​nsb2017|web page]] on %%GitHub%%. There, click the button "Clone in desktop",​ and your %%GitHub%% client should prompt you to accept the clone (tested successfully with Chrome, %%YMMV%%). If this fails, you can [[http://​joe.blog.freemansoft.com/​2014/​04/​github-clone-to-desktop-with-windows.html|drag]] the URL from your browser into your %%GitHub%% client. + Now, verify that the above steps have resulted in the creation of a ''​nsb2019''​ folder with various subfolders and files in it, indicating that you have a local copy of the codebase. Because Git is tracking the contents of this folder, it is now easy to "​pull"​ the latest version from %%GitHub%%: - + - Now, verify that the above steps have resulted in the creation of a ''​nsb2019''​ folder with various subfolders and files in it, indicating that you have a local copy of the codebase. Because Git is tracking the contents of this folder, it is now easy to "​pull"​ the latest version from %%GitHub%%, either from the command line (after you ''​cd''​ into the ''​nsb2019''​ folder): + <​code>​ <​code>​ git pull git pull ​ - - Or, by clicking the ''​Sync''​ button in the %%GUI%%. This "​pull"​ should do nothing, because you already have the latest version. The basic idea is that you can stay up-to-date easily as well as contribute to the codebase so that everyone else can benefit. As you might expect, that part is known as a "​push",​ which we will do in the next step. This "​pull"​ should do nothing, because you already have the latest version. The basic idea is that you can stay up-to-date easily as well as contribute to the codebase so that everyone else can benefit. As you might expect, that part is known as a "​push",​ which we will do in the next step. Line 58: Line 52: Open the ''​README.md''​ file in the ''​nsb2019''​ folder. The ''​.md''​ extension is for %%Markdown%%,​ a lightweight set of commands to format text (syntax reference is [[https://​help.github.com/​articles/​markdown-basics | here]]). Open the ''​README.md''​ file in the ''​nsb2019''​ folder. The ''​.md''​ extension is for %%Markdown%%,​ a lightweight set of commands to format text (syntax reference is [[https://​help.github.com/​articles/​markdown-basics | here]]). - Add your name, affiliation and a brief description of your interests to the list, and save the file. Then go to your git shell (open one with the gear icon in the top right of your client's %%GUI%%, or use the desktop icon) and type ''​git status''​. Git has noticed the change, but it says that this change is not yet "​staged for commit"​. In other words, git is not tracking this file. Let's fix this: + Add your name, affiliation and a brief description of your interests to the list, and save the file. Then navigate ​to the ''​nsb2019''​ repository in a shell and type ''​git status''​. Git has noticed the change, but it says that this change is not yet "​staged for commit"​. In other words, git is not tracking this file. Let's fix this: <​code>​ <​code>​ Line 65: Line 59: ​ - If you now do a ''​git status''​ you will see that you are ahead of the origin (the online repository) by 1 commit. This makes sense because you just made a change. Let's push this by doing ''​git push''​. If you get an "​access denied"​ type error, email me (mvdm at dartmouth dot edu) your %%GitHub%% username and I will give you permission. If everything goes to plan you should now be able to see the updated README file [[https://​github.com/​mvdm/​nsb2017| on GitHub]]. As above, you can also use the %%GUI%% ''​Sync''​ button to accomplish the same steps (albeit in a less transparent manner). + If you now do a ''​git status''​ you will see that you are ahead of the origin (the online repository) by 1 commit. This makes sense because you just made a change. Let's push this by doing ''​git push''​. If you get an "​access denied"​ type error, email me (mvdm at dartmouth dot edu) your %%GitHub%% username and I will give you permission. If everything goes to plan you should now be able to see the updated README file [[https://​github.com/​mvdm/​nsb2019| on GitHub]]. A schematic of these basic operations (pull, commit, push) is shown below, using the amazing [[https://​www.dokuwiki.org/​plugin:​graphviz|DokuWiki plugin]] for [[http://​www.graphviz.org/​|GraphViz]]:​ A schematic of these basic operations (pull, commit, push) is shown below, using the amazing [[https://​www.dokuwiki.org/​plugin:​graphviz|DokuWiki plugin]] for [[http://​www.graphviz.org/​|GraphViz]]:​ Line 81: Line 75: === Using GitHub to acquire the FieldTrip toolbox === === Using GitHub to acquire the FieldTrip toolbox === - Using your experience from the previous section, create a local clone of the [[https://​github.com/​fieldtrip/​fieldtrip|FieldTrip toolbox]]. If you are using the command line, make sure that you ''​cd''​ to your %%GitHub%% folder, i.e. that you are not within some other project such as ''​nsb2019'',​ before cloning. If things worked correctly you should have ''​fieldtrip''​ and ''​nsb2019''​ folders within your %%GitHub%% folder; **not** a ''​fieldtrip''​ folder within your ''​nsb2019''​ folder! + Using your experience from the previous section, create a local clone of the [[https://​github.com/​fieldtrip/​fieldtrip|FieldTrip toolbox]]. If you are using the command line (shell), make sure that you ''​cd''​ to your %%GitHub%% folder, i.e. that you are not within some other project such as ''​nsb2019'',​ before cloning. If things worked correctly you should have ''​fieldtrip''​ and ''​nsb2019''​ folders within your %%GitHub%% folder; **not** a ''​fieldtrip''​ folder within your ''​nsb2019''​ folder! We will use this toolbox extensively for the analysis of local field potential (LFP) data. Be aware that it is about 1.2GB in size! We will use this toolbox extensively for the analysis of local field potential (LFP) data. Be aware that it is about 1.2GB in size!