Online Repository in Git
GitHub is a social network for programmers for software development projects using git revision management system. It also has a standard GUI application for direct download (Windows, Mac, GNU / Linux) to your computer from web sites. But in this tutorial, we only consider the CLI section.
Create GitHub repository
Go to github.com. If you already have a GitHub account, then log in to the system with your account or create a new account. Follow the steps in github.com to create a new repository.
Push operation
Tom decided to use GitHub server. To start a new project, he creates a new folder and a file in it.
[tom @ CentOS] $ mkdir github_repo
[tom @ CentOS] $ cd github_repo /
[tom @ CentOS] $ vi hello.c
[tom @ CentOS] $ make hello
cc hello.c -o hello
[tom @ CentOS] $ ./hello
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.
Pull activity
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
You should read it
May be interested
- What is Shodan? How can it improve online security?shodan is like google but more of a repository of internet of things (iot) devices. while google indexes web pages on the world wide web and the content on these websites, shodan indexes every device directly connected to the internet.
- Snapchat source code is revealed on GitHuba repository (repository - repo) called source-snapchat has been uploaded to github by a user named i5xx in tando bago village, sindh province in southeastern pakistan.
- How to play Among Us Online, download Among Us Onlineamong us online can be considered a practice version, helping those who are new to playing will become professional killer impostors.
- How to expand the Netflix movie repository in Vietnam?due to copyright and legal issues, netflix users in vietnam are quite limited, can only access about 11% of the total amount of movies available on netflix. this is a disadvantage for us when the subscription fee still has to be fully paid and the service is not as satisfactory. but don't worry, we'll share with you how to expand the netflix movie repository in vietnam in the article below. please refer to dentist.
- Mozilla opens a web application store for many types of browsersmozilla will launch the mozilla marketplace online web application store on the occasion of the world mobile congress - mobile world congress 2012. applications in this repository are written for multiple platforms and browsers.
- How to speed up playing FIFA Online 4fifa online 4 has officially launched players in vietnam after the beta experience days. so what is the standard configuration for installing fifa online 4 and how to speed up the game on the computer?
- How to Know if Someone Is Onlineif you'd like to know whether someone is online, there are various ways to do this. depending on whether you're after someone's online profile or you want to know if someone is actually online at the same time as you, there are different...
- How to use Word Online to edit text onlineword online is located in microsoft's online office editor. users will not need to install the software, but can still edit content with all the same features as office word.
- How to receive FIFA Online key 4 Close Beta versionofficial fifa online 4 vietnam home page has opened a key program to participate in testing fifa online 4 with a very simple way.
- Latest Xeno Online 2 Code and how to enterxeno online 2 is a game introduced by xeno two studios to the gaming community through the roblox platform. join tipsmake.com to discover a series of attractive giftcodes that will bring you tons of coins and free spins.