Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Git-Zenodo-Assistant
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
María José Ramos
Git-Zenodo-Assistant
Commits
895bad08
Commit
895bad08
authored
4 years ago
by
María José Ramos
Browse files
Options
Downloads
Patches
Plain Diff
fixed git tutorial
parent
d236622b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
git_assistant/git_tutorial.py
+12
-9
12 additions, 9 deletions
git_assistant/git_tutorial.py
with
12 additions
and
9 deletions
git_assistant/git_tutorial.py
+
12
−
9
View file @
895bad08
...
@@ -26,6 +26,8 @@ password = colored('password', 'cyan')
...
@@ -26,6 +26,8 @@ password = colored('password', 'cyan')
token
=
colored
(
'
token
'
,
'
cyan
'
)
token
=
colored
(
'
token
'
,
'
cyan
'
)
gitlab
=
colored
(
'
GitLab
'
,
'
cyan
'
)
gitlab
=
colored
(
'
GitLab
'
,
'
cyan
'
)
github
=
colored
(
'
GitHub
'
,
'
cyan
'
)
github
=
colored
(
'
GitHub
'
,
'
cyan
'
)
green
=
colored
(
'
Green
'
,
'
green
'
)
red
=
colored
(
'
Red
'
,
'
red
'
)
copy
=
colored
(
"
COPY
"
,
"
green
"
,
attrs
=
[
'
reverse
'
])
copy
=
colored
(
"
COPY
"
,
"
green
"
,
attrs
=
[
'
reverse
'
])
paste
=
colored
(
"
PASTE
"
,
"
green
"
,
attrs
=
[
'
reverse
'
])
paste
=
colored
(
"
PASTE
"
,
"
green
"
,
attrs
=
[
'
reverse
'
])
...
@@ -116,7 +118,7 @@ A {git} remote origin is the name for the remote repository of a {git}
...
@@ -116,7 +118,7 @@ A {git} remote origin is the name for the remote repository of a {git}
directory. If you try to execute
{
git
}
commands in the wrong remote
directory. If you try to execute
{
git
}
commands in the wrong remote
repository, you will encounter errors. To make sure this do not
repository, you will encounter errors. To make sure this do not
happen while running the tutorial, we are going to remove the previous
happen while running the tutorial, we are going to remove the previous
origin.
origin
just in case
.
"""
"""
print
(
rm_message
)
print
(
rm_message
)
...
@@ -131,7 +133,7 @@ os.system("clear")
...
@@ -131,7 +133,7 @@ os.system("clear")
origin_message
=
f
"""
origin_message
=
f
"""
Now, let
'
s add a new origin. You will need to provide the url of the
Now, let
'
s add a new origin. You will need to provide the url of the
{
git
}
repo where you want to
you
{
git
}
{
push
}
.
{
git
}
repo where you want to
{
git
}
{
push
}
.
"""
"""
print
(
origin_message
)
print
(
origin_message
)
...
@@ -168,8 +170,8 @@ os.system("clear")
...
@@ -168,8 +170,8 @@ os.system("clear")
# Git status
# Git status
status_message
=
f
"""
status_message
=
f
"""
{
git
}
status shows the current state of your
{
git
}
working directory
{
git
}
status shows the current state of your
{
git
}
working directory
and staging area.
G
reen shows file in
{
git
}
repository, committed
and staging area.
{
g
reen
}
shows file in
{
git
}
repository, committed
with latest changes.
R
ed shows file in
{
git
}
repository, but with
with latest changes.
{
r
ed
}
shows file in
{
git
}
repository, but with
latest changes that have not been committed. If you do not
{
add
}
the
latest changes that have not been committed. If you do not
{
add
}
the
red files before committing, these files will not be included in
red files before committing, these files will not be included in
your
{
commit
}
.
your
{
commit
}
.
...
@@ -184,10 +186,10 @@ input(f"\nDone! Press {enter} to continue.\n")
...
@@ -184,10 +186,10 @@ input(f"\nDone! Press {enter} to continue.\n")
# Git add
# Git add
add_message
=
f
"""
add_message
=
f
"""
To
{
git
}
{
add
}
, you have to pick a file in red from the
list
To
{
git
}
{
add
}
, you have to pick a file in
{
red
}
from the
above and copy the name. Then, paste the name
of your file
status list
above and copy the name. Then, paste the name
and do not forget the extension (example.ipynb)
.
of your file
and do not forget the extension (example.ipynb)
,
or type
{
allfiles
}
to add all the files in the directory.
or type
{
allfiles
}
to
{
add
}
all the files in the directory.
"""
"""
print
(
add_message
)
print
(
add_message
)
file
=
input
(
str
(
f
"
Please paste the name of your file or type
{
allfiles
}
:
"
))
file
=
input
(
str
(
f
"
Please paste the name of your file or type
{
allfiles
}
:
"
))
...
@@ -258,7 +260,8 @@ os.system(f"git push {url}")
...
@@ -258,7 +260,8 @@ os.system(f"git push {url}")
input
(
f
"
\n
Done! Press
{
enter
}
to continue.
\n
"
)
input
(
f
"
\n
Done! Press
{
enter
}
to continue.
\n
"
)
# Check the git push
# Check the git push
print
(
f
"
Go to:
\n
{
url
}
\n
to see if the
{
push
}
was successful.
"
)
print
(
f
"
Go to:
\n
{
url
}
\n
to see if the
{
push
}
was successful.
\n
"
f
"
Check out the master branch if you do not see the file in the main branch.
"
)
push_answer
=
input
(
str
(
"
Has your file been pushed correctly? y/n:
"
))
push_answer
=
input
(
str
(
"
Has your file been pushed correctly? y/n:
"
))
while
push_answer
==
"
n
"
:
while
push_answer
==
"
n
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment