Pages

Friday, August 16, 2019

Fedora 30 : First steps with Fedora and GitHub.

In this tutorial I will show you how you can use Fedora and your GitHub account for your projects.
Let's solve this issue in a simple way.
First, you need to install the git tool with dnf tool:
[root@desk mythcat]# dnf -y install git
Let's see the version of this tool with a regular user:
[mythcat@desk ~]$ git --version
git version 2.21.0
Let's set up the user for my GitHub account:
[mythcat@desk ~]$ git config --global user.name "catafest"
[mythcat@desk ~]$ git config --global user.email "catafest@yahoo.com"
You can see it later with this command:
[mythcat@desk ~]$ git config --list
[mythcat@desk ~]$ git config --global --list
I used this commands to create a folder for my git projects:
[mythcat@desk ~]$ mkdir project_github
[mythcat@desk ~]$ cd project_github/ 
Now I can download my GitHub project named flask_yt from here:
[mythcat@desk project_github]$ git clone https://github.com/catafest/flask_yt.git
Cloning into 'flask_yt'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 23 (delta 1), reused 14 (delta 0), pack-reused 0
Unpacking objects: 100% (23/23), done.
If you don't have one then you can create your new project on your GitHub account. Let's make some changes into README.md file:
[mythcat@desk project_github]$ cd flask_yt/
[mythcat@desk flask_yt]$ vim README.md 
...
Now I can use git tool:
[mythcat@desk flask_yt]$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

        modified:   README.md

no changes added to commit (use "git add" and/or "git commit -a")
[mythcat@desk flask_yt]$ git add *
[mythcat@desk flask_yt]$ git commit -m "first commit"
[master 56f1e53] first commit
 1 file changed, 1 insertion(+)
Now I can use my username and password from GitHub when I run this command:
[mythcat@desk flask_yt]$ git push origin master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 2 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 352 bytes | 352.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/catafest/flask_yt.git
   5ecffdd..56f1e53  master -> master 
The changes from README.md will be send to my GitHub website.