POP77001 Computer Programming for Social Scientists
.R files - R scripts.py files - Python scripts.ipynb extension for interactive python notebookjupyter notebookNew and select Python from the drop-down menuInsert, Insert Cell BelowCodeMarkdown in the drop-down menu on the toolbarFile and then Close and HaltQuit in the upper right corner of your main Jupyter tab (located at http://localhost:8888/) Microsoft PowerShell (Windows)
Z shell, zsh (macOS)
bash (Linux/UNIX)
| Command (Windows) | Command (macOS/Linux) | Description |
|---|---|---|
exit |
exit |
close the window |
cd |
cd |
change directory |
cd |
pwd |
show current directory |
dir |
ls |
list directories/files |
copy |
cp |
copy file |
move |
mv |
move/rename file |
mkdir |
mkdir |
create a new directory |
del |
rm |
delete a file |
Extra
| Command | Description |
|---|---|
git init <project name> |
Create a new local repository |
git clone <project url> |
Download a project from remote repository |
git status |
Check project status |
git diff <file> |
Show changes between working directory and staging area |
git add <file> |
Add a file to the staging area |
git commit -m “<commit message>” |
Create a new commit from changes added to the staging area |
git pull <remote> <branch> |
Fetch changes from remote and merge into merge |
git push <remote> <branch> |
Push local branch to remote repository |
Extra
mkdir test in your CLI/Terminalcd test commandgit init command in this directorytest.txt in your local test repositorygit add test.txt commandgit commit -m "Added first file"git add <file> would be commitedgit status (it should say ‘nothing to commit, working tree clean’)git log and make sure that you see your commithttps://github.com/<username>/<repository_name>.git
git remote add origin <project_url>
- where:
- `git remote add` is the command,
- `origin` is the name given to this link (`<remote>`), and
- `<project_url>` is the URL of the repository on GitHub
git remote -v
git remote is the command, and-v is the argument ‘verbose’git push command for that.git branch to see the name of the branch you are on (it would be ‘main’ or ‘master’)git push <remote> <branch> (e.g. git push origin main)
git push is the command,<remote> is the name of the remote link, and<branch> is the name of the branch.test.txt file