"Replace /users/filepath/etc with the filepath of the local git directory you wish to work on."
"Replace /example/filepath/etc with the filepath of your git directory."
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cd /example/filepath/etc"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Choose branch you would like to work on. (syntax: git checkout branch_name) \\\n",
"If you need to create a new branch, type this to create a branch and switch to it: git checkout -b branch_name"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cd /Users/filepath/etc"
"git checkout branch_name"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Choose branch you would like to work on. (syntax: git checkout branch_name)"
"# Pull\n",
"Always pull before working on files with git to ensure you have the latest version. \n"
]
},
{
...
...
@@ -43,7 +61,7 @@
"metadata": {},
"outputs": [],
"source": [
"git checkout develop"
"git pull origin branch_name"
]
},
{
...
...
@@ -67,12 +85,12 @@
"metadata": {},
"source": [
"<h4>Step 2</h4>\n",
"Choose file to commit. Replace /example/filepath/etc with path of file you would like to commit. (Note: If you would like to commit multiple files at once with the same commit message, you can do so by adding the parent folder of all edited files. Git will only apply this commit message to files that have changes.)"
"Choose file to commit. Replace /example/filepath/etc with the filepath of the file you would like to commit. (Note: If you would like to commit multiple files at once with the same commit message, you can do so by adding the parent folder of all edited files.)"
"Use this to update files in the remote repository with your committed files. Note: You may run into errors if the local branch you are pushing does not have the same name as the remote branch you are pushing to (e.g. trying to push from a local branch named \"testing\" to a branch in the GitLab repository named \"develop\"). It is recommended you push from a branch with the same name as the remote branch you are trying to push to."
"Use this to update files in the remote repository with your committed files. Only try to push to branches with the same name as the one on your machine. (e.g. if you want to push a branch named \"nps-develop\", you should type \"git push origin nps-develop\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"See a list of all files you have made commits to since your last push."
Replace /users/filepath/etc with the filepath of the local git directory you wish to work on.
Replace /example/filepath/etc with the filepath of your git directory.
%% Cell type:code id: tags:
``` python
cd/Users/filepath/etc
cd/example/filepath/etc
```
%% Cell type:markdown id: tags:
Choose branch you would like to work on. (syntax: git checkout branch_name)
Choose branch you would like to work on. (syntax: git checkout branch_name) \
If you need to create a new branch, type this to create a branch and switch to it: git checkout -b branch_name
%% Cell type:code id: tags:
``` python
gitcheckoutdevelop
gitcheckoutbranch_name
```
%% Cell type:markdown id: tags:
# Pull
Always pull before working on files with git to ensure you have the latest version.
%% Cell type:code id: tags:
``` python
gitpulloriginbranch_name
```
%% Cell type:markdown id: tags:
# Make a Commit
Use this to finalize a file edit and provide a reason
%% Cell type:markdown id: tags:
<h4>Step 1</h4>
Make a change to your file
%% Cell type:markdown id: tags:
<h4>Step 2</h4>
Choose file to commit. Replace /example/filepath/etc with path of file you would like to commit. (Note: If you would like to commit multiple files at once with the same commit message, you can do so by adding the parent folder of all edited files. Git will only apply this commit message to files that have changes.)
Choose file to commit. Replace /example/filepath/etc with the filepath of the file you would like to commit. (Note: If you would like to commit multiple files at once with the same commit message, you can do so by adding the parent folder of all edited files.)
%% Cell type:code id: tags:
``` python
gitadd/example/filepath/etc
```
%% Cell type:markdown id: tags:
<h4>Step 3</h4>
Place your reason for the commit inside quotes. If this is a new file to the repository, simply put "initial commit".
%% Cell type:code id: tags:
``` python
gitcommit-m"initial commit"
```
%% Output
[master 916ccdb] removed 96, deleted fiber
3 files changed, 0 insertions(+), 0 deletions(-)
%% Cell type:markdown id: tags:
# Push
Use this to update files in the remote repository with your committed files. Note: You may run into errors if the local branch you are pushing does not have the same name as the remote branch you are pushing to (e.g. trying to push from a local branch named "testing" to a branch in the GitLab repository named "develop"). It is recommended you push from a branch with the same name as the remote branch you are trying to push to.
Use this to update files in the remote repository with your committed files. Only try to push to branches with the same name as the one on your machine. (e.g. if you want to push a branch named "nps-develop", you should type "git push origin nps-develop")
%% Cell type:markdown id: tags:
See a list of all files you have made commits to since your last push.