Git Lab
Navigate to https://github.com/
Fill out the 3 mandatory fields, make sure all have green check next to them
Fill out the 3 mandatory fields, make sure all have green check next to them
Follow the prompts and select student account
Once your account is created, create a git repository, click on Create Repository
Name it Python and, select wether you would like to make it public or private. Either option should work ok. If you make it public, then you can use the repo to showcase your work in future when applying for jobs. I am not concerned with your homework being visible to other students, because it is not graded.
Keep the README and .gitignore options checked, those are important features of git and we will learn how to use them
Keep the README and .gitignore options checked, those are important features of git and we will learn how to use them
This is what your repo should look like:
Go to Settings -> Manage Access -> Invite Collaborators, enter gnurmatova
I should receive an invitation now
Clone your repo.
You can use http method like in the screenshot below or set up your ssh keys and then use ssh method
You can use http method like in the screenshot below or set up your ssh keys and then use ssh method
$ git clone https://github.com/Funk0/python.git Cloning into 'python'... Username for 'https://github.com': Funk0 Password for 'https://[email protected]': remote: Enumerating objects: 4, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (3/3), done. remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (4/4), done. $ ls python
Create a py script and upload it, you can use the following commands:
git add . |
sends the changes you made into staging area, in other words, it - goes and finds all the changes in the current directory and recursively in any sub-directories. You do not have to use . with git add, you can use specific files and folders you want considered for finding changes, but most of the time just the . will be all you need.
|
git commit -m "initial commit" |
creates the snapshot of your changes and "stamps" them with a commit id. The comment, in this case "initial commit" is used to explain the changes made to other developers
|
git push |
pushes your changes up to the remote repository
|
$ git add . $ git commit -m "initial commit" [master cb61491] initial commit 1 file changed, 1 insertion(+) create mode 100644 homework1.py $ git push Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 332 bytes | 332.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/Funk0/python.git e8b96a7..cb61491 master -> master
you should now see the new file in your repo