Git: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 9: | Line 9: | ||
== Clone Repository == | == Clone Repository == | ||
<pre> | <pre> | ||
git clone git@gitlab.com:scottcamacmartin/ | git clone git@gitlab.com:scottcamacmartin/my_project.git | ||
</pre> | </pre> | ||
== Upload Existing Code Directory as Gitlab Repository == | |||
First, creat a new project on gitlab. Then, on the local dev machine: | |||
<pre> | |||
git clone git@gitlab.com:scottcamacmartin/my_project.git | |||
cd my_project | |||
# then copy code into new folder my_project | |||
# also set up .gitignore file | |||
git status | |||
git add . | |||
git commit -m "initial commit" | |||
git push -u origin master | |||
</pre> | |||
== Cheat Sheet == | == Cheat Sheet == | ||
https://about.gitlab.com/images/press/git-cheat-sheet.pdf | https://about.gitlab.com/images/press/git-cheat-sheet.pdf |
Revision as of 14:43, 3 January 2021
Initial Setup
git config --global user.name "Harry Truman" git config --global user.email "harry.truman@example.com" git config --global --list
May need to set up SSH-key authentication for gitlab.
Clone Repository
git clone git@gitlab.com:scottcamacmartin/my_project.git
Upload Existing Code Directory as Gitlab Repository
First, creat a new project on gitlab. Then, on the local dev machine:
git clone git@gitlab.com:scottcamacmartin/my_project.git cd my_project # then copy code into new folder my_project # also set up .gitignore file git status git add . git commit -m "initial commit" git push -u origin master