The above command will produce the following result:
Hello, World !!!
After verifying his code, he starts working with the directory with the git init command and commits his internal changes.
[tom @ CentOS] $ git init
Initialized empty Git repository in /home/tom/github_repo/.git/
[tom @ CentOS] $ git status -s
?? hello
?? hello.c
[tom @ CentOS] $ git add hello.c
[tom @ CentOS] $ git status -s
A hello.c
?? hello
[tom @ CentOS] $ git commit -m 'Initial commit'
After that, he adds GitHub repository URL as a remote control and pushes his changes to this remote repository.
[tom @ CentOS] $ git remote add origin https://github.com/kangralkar/testing_repo.git
[tom @ CentOS] $ git push -u origin master
Push operation will require user account and password on GitHub. After successful login, push operation will be successfully performed.
The above command will produce the following result:
Username for 'https://github.com': kangralkar
Password for 'https: //kangralkar@github.com':
Counting objects: 3, done.
Writing objects: 100% (3/3), 214 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/kangralkar/test_repo.git
* [new branch] master -> master
Branch master được đặt vào trình phục vụ người dùng xa từ origin.
Starting now, Tom can push any changes to the GitHub repository. He can use all the commands mentioned in this tutorial with the GitHub repository.
Tom has successfully pushed all the changes to the GitHub repository. Now, other programmers can observe those changes by performing a simulation operation or updating their local repository.
Jerry creates a new folder in the home directory and simulates the GitHub GitHub repository using the git clone command.
[jerry @ CentOS] $ pwd
/ home / jerry
[jerry @ CentOS] $ mkdir jerry_repo
[jerry @ CentOS] $ git clone https://github.com/kangralkar/test_repo.git
The above command will produce the following result:
Cloning into 'test_repo' .
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 3 (delta 0)
Unpacking objects: 100% (3/3), done.
He verifies the directory contents by running the ls command.
[jerry @ CentOS] $ ls
test_repo
[jerry @ CentOS] $ ls test_repo /
hello.c
According to Tutorialspoint
Last lesson: Stash operation in Git
Next lesson: Operating Rename in Git