RedStealthDev
0ace6ecaa2
|
1 year ago | |
---|---|---|
.gitignore | 2 years ago | |
README.md | 1 year ago |
README.md
How To Git <3
Table Of Contents
- Part 1 Setting up account
- Part 2 SSH keys
- Part 3 Setting up github desktop
- part 4 Finishing up
- Usage
Part 1 Setting up account
- First of all Register here.
- Ask your organization owner to add you to the organization you can move on after telling them.
Part 2 SSH keys
- Press the windows key, search for
cmd
and open the black box. - Write
ssh-keygen -t ed25519 -C "your_email@example.com"
replacing "your_email@example.com" with your own and press enter.- Press enter on all questions.
- Press the windows key, search for
services
and press the blueish cogs. - Scroll down and find
OpenSSH Authentication Agent
Right click and pressPreferences
. - Open the
StartMethod
dropdown and selectAutomatic (Delayed start)
. - Press apply then press start. you can now exit the
Services
app. - Open
File Explorer
and navigate toC:\Users\"YOUR NAME"\.ssh
. - Make sure that you have File extentions enabled in the show menu of File Explorer.
- Now Make a Text Document and name it
config
with no extention. - Open
config
in notepad and writeAddKeysToAgent yes
. - Now back in cmd write
ssh-add .ssh/id_ed25519
and press enter.- You can close cmd now.
- Open this Link and press add key.
- Now in the
.ssh
folder we opened earlier you should find aìd_ed25519.pub
.- Open it and copy the contents.
- Paste the text from
ìd_ed25519.pub
in the big box on the ssh key page we opened and rename it to something relevant like laptop or school. - Finish of this part by pressing the
Add Key
button under the big box.
Part 3 Setting up github desktop
- First of all if you havent gotten github desktop downloaded yet then download it here and install.
- On the welcome page that opens after installation press the gray text that states
Skip this step
- Now fill in the user and email that you have for this page and press continue.
- Once your inside there will be three buttons press
Clone a repository
. - Now open the url tab and contine here.
- Go to the homepage of this website and find the
Organization
tab on the left. - Under the tab you should see a organization if you dont then ask your organization owner to add you again.
- Now open that organization and press the big text in the empty space with your projects name on it.
- Here you will have to find the
https and SSH
buttons and press the ssh one. - Next to the
SSH
button you will now see a link. Copy that link and paste it in the url spot and change file location if needed. - Press the clone button.
part 4 Finishing up
- Wait until you see that the spinning arrows have stopped and the text under says
Last fetched just now.
- Open unity hub and press the down arrow next to open and select add project from disk.
- Find your project were you put it default dir is
C:\users\YOURNAME\Documents\github\PROJECTNAME
and select.
Usage
Table of Usage
What is git
Git
is a repository management system and can be explained as a google drive folder shared to everyone added to it.
But this drive folder is special because this folder can save your old changes additions and deletions of your files.
Lets say you added a image long ago that you think isnt needed anymore and decide to delete it.
But The whole program breaks and you nead that file back, so instead of remaking or finding it again you can yust use the special feature of git that allows you to undo the deletion and go back to before it happened.
This is one strength but not the only one that Git has and there is one more i want to explain.
So lets say that you are a big team of programmers that are working on a project but how would you go about getting the new code to work with the old.
That is were Git's feature called branches come in they are basicaly a copy of the main folder branches of with some new code like maby you make a script that handles the main menu.
And when that code is done you can do a merge/pull request
and turn the branch around so that it connects back to the main project again.
Commit Pull Push
So first i will explain what these are and then i will show you how.
Commiting is the time that you say to git that it should save your changes.
This dose not upload it to the server yet it yust saves it localy so you can go back if you want to.
Pulling and pushing are quite self explanatory they download/upload
your/the Servers
changes.
One extra thing here is Fetching.
Fetching is not the same as pulling it sounds like it could be but its not.
Fetching is when you ask the server if it has some changes or new branches that you could download.\
- Commiting in Github Desktop is quite easy to do this all you have to do is open Github Desktop and write a small message about what you changed after the last commit.
The box to write in saysSummary (Required)
and is located bottom left corner.
If you want a longer message you can write it in the bigger box that saysDescription
.
When you are done you yust press the big blue button with the nameCommit to (BranchName)
.\ - Pushing in Github Desktop may be the easiest one because you only nead to do it after a commit so after commiting you will see a a button on the top bar that usualy says fetch is now blue and says push. If you press that then all your changes that you commited will be sent to the server so others can pull it.
- Fetching is also easy you yust press
Fetch Origin
on the top button bar. - Pull is on the same button as fetch and is the time that you download the changes from the server.