Today, I will try to explain to you what this issue does and how it should be done as much as my tongue turns. If there are some points that you cannot do or can not enlighten you, you can comment on this topic or contact me by e-mail.
First of all, what kind of benefit will it give us to throw code from the Terminal?
Yes, this question is very simple. If any man has written a smart project, you have seen the difficulty of transferring it to the environment like github. If it is necessary to explain it, it is necessary to create new repo and copy and save the code repo one by one, and this is very tiring for big projects no matter where you look and wherever you look 15- It will take 20 minutes, perhaps hours. That’s why we need to use the terminal.
So how can we assign a Code to this github from this terminal?
As I stated in this article, I will use the terminal. So, as you can see, it is valid for the open source operating system such as ubuntu.
Terminal on Github now the first thing we need to do is:
To install Git through the terminal, we write below to install Git.
sudo apt-get install git
After completing this, we need to get ssh-key from Github.
We must record our username and e-mail address to the system.
git config –global user.name “your username”
git config –global user.email “github mailiz”
Let’s come to create SSH-Key
We have to write this code through the terminal.
ssh-keygen -t rsa -C “firstname.lastname@example.org
Next, you are asked to enter a password.
Enter passphrase (empty for no passphrase): [Type a passphrase]
There should be such a text on our screen
Your identification has been saved in /home/you/.ssh/id_rsa. # Your public key has been saved in /home/you/.ssh/id_rsa.pub. # The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
Next, let’s add the new key to ssh-agent:
#start the ssh-agent in the background
$ eval “$(ssh-agent -s)”
# Agent pid 59566
$ ssh-add ~/.ssh/id_rsa
Let’s run the code to copy the key we created.
$ sudo apt-get install xclip # Downloads and installs xclip. If you don’t have `apt-get`, you might need to use another installer (like `yum`) $ xclip -sel clip < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
After copying the key, let’s add it to the Githuba account. We need to enter the address below and add
We click the Add SSH Key button and paste and save the name and ssh key to our ssh Key.
Important Note: The above items are for one time only.
Then we proceed to upload projects to githuba.
First, create a new repository. When you open the repo you have created, you should write what you need to do in the terminal.
Create a file with the same name on Desktop
Next, let’s put the files and codes you need to upload.
touch README.md ==> creates the Readme File in the directory we are in.
git init ==> done only once
git add README.md ==> adding github
git add file_name ==> We write the name of the file we will upload
git commit -m “first commit” ==> For adding comments.
git remote add origin https://github.com/gursesarmutcu/Repo.git ==> done once.
git push -u origin master
When we renew the github after these commands, it will be seen that the inside of the repo is full.
When we refresh the github page after these commands, it will be seen that the repo is full.
If you encounter any problems, you can post comments.
Have a nice day…
To read to read my other blog posts: “https://www.flutteranywhere.com“