Skip to content
Snippets Groups Projects
Commit 2ee56008 authored by Wigal, Jacob (CIV)'s avatar Wigal, Jacob (CIV) :sparkles:
Browse files

Update gitlab-commit_and_push.ipynb

parent 6bf9f7f9
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
### About
This notebook is for the following functions:
- making a commit
- pushing changed files and/or new files from your computer to GitLab
%% Cell type:markdown id: tags:
# Startup git
Replace /example/filepath/etc with the filepath of your git directory.
%% Cell type:code id: tags:
``` python
cd /example/filepath/etc
```
%% Cell type:markdown id: tags:
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
git checkout branch_name
```
%% Cell type:markdown id: tags:
# Pull
Always pull before working on files to ensure you have the most up to date version of your branch.
Always pull before working on files to ensure you have the most up-to-date version of your branch.
%% Cell type:code id: tags:
``` python
git pull origin branch_name
```
%% Cell type:markdown id: tags:
# Make a Commit
Use this to finalize a file edit or addition and provide a reason
%% Cell type:markdown id: tags:
<h4>Step 1</h4>
Make a change to your file, or place a new file to be pushed somewhere in your local git folder structure.
%% Cell type:markdown id: tags:
<h4>Step 2</h4>
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
git add /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
git commit -m "initial commit"
```
%% Cell type:markdown id: tags:
# Push
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:
(syntax: git push origin branch_name)
%% Cell type:code id: tags:
``` python
git push origin branch_name
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment