Hello Friends! The below git tutorial article will give you the complete knowledge of GitHub. With the article, you will learn how you will build software and make your version control system. The revision GitHub action secrets will give you the option to store your working project backup, easy to make live changes, and easy work environment.
In the GitHub tutorial, we will talk about each important point that is necessary to work on github pages or projects.
First, we will go through what is GitHub and its pricing and features then we will move on to how to pull, push, and delete the repositories and other github commands.
GitHub and GitLab
GitHub and GitLab is the plan of action where knowledge, reality, existence, and an academic discipline are present. GitHub has higher convenience and is focused on infrastructure achievement, while GitLab is engaged in offering a features-based network with a centralized, combined platform for developers.
Github Enterprise Login
The numbers of developer are working with normal github login account to manage their personal project or transfer knowledge to the public. There they will get the best service and free of cost package for their daily usages.
If you are looking to team plans for your business as an owner or manager then github enterprise login will give you huge options like space, at a time number of team members, can work, automated process to make site live or set staging environment, etc.
Github Enterprise Pricing
To get the pricing of enterprise GitHub version comes with three plans:
- The basics for individuals and organizations – Free
- Unlimited public/private repositories
- Packages storage includes 500MB
- Free 2,000 automation minutes/month for public repositories
- New Issues & Projects (beta)
- Community support
- Advanced collaboration for individuals and organizations – For Team
- Protected branches
- Multiple reviewers in pull requests
- Draft pull requests
- Code owners
- Required reviewers
- Pages and Wikis
- Free 3,000 automation minutes/month for public repositories
- Packages storage is 2GB
- Web-based support
- Security, compliance, and flexible deployment – Enterprise
- Automatic security and version updates
- SAML single sign-on
- Advanced auditing
- GitHub Connect
- Free for 50,000 automation minutes/month public repositories
- 50GB of Packages storage
The github basically used by developers to manage their development version so, it is hugely downloaded for desktop. The desktop version you can get with the below link click. The link will open the Github download page in a new window and from there you will get the zip file to download.
To work on any project first you have to make a public or private Github repository where you will perform all the below github actions. The versioning of code or database can be saved as a github pages and re-use on the live server to restore the website or software.
The operations on GitHub can be performed by github API or GitHub command but here we will look into some important commands to Deploy, Delete, Pull, Actions Secrets, and Revision Control System manage.
Let’s start with one project where we will use git and work as a version control system:
- First install the “Git bash” that will give you linux command prompt to use git commands easily.
- Now create a folder with name git-test on desktop.
- Go into the command prompt and use below command and enter to get into the folder
$ cd git-test
- After the above command run need to run below command to add git in the git-test folder and this will be work as a master branch.
$ git init
- Now the system will show you, your repository is empty and you need to add some files. To add files you need to use “touch” command.
$ touch index.php And $ touch readme.txt
- Now to check status of repository the files has already been in your repository or upto date or not. You need to use “status” command.
$ git status
- Now if file is not in your repository then use “add” command to add files and check status again.
$ git add . (Here dot use to add all files or you can use add the name of the file to add)
$ git status
- After adding a file, you need to use ”commit” command to update the changes that mean you need to tell system what is in current version of file (also call version control system) and command look like below:
$ git commit – m “first message”
- Now make any changes in the any file and run “status” command that will show you a message you have made changes in these files but not added into the repository.
- To add file in repository you need to add and commit the respective file with name. Suppose you have added some changes in readme.txt file then use below:
$ git add readme.txt $ git commit –m “readme file updated”
- If you want to delete the file, then you need to use the “RM” command to delete the file from master branch. After delete the file you have to re commit the repository.
$ git touch deletefile.php // add file coincidently $ git rm --cached deletefile.php $ git commit –m “deletefile.php has been deleted”
- If you want to remove all deleted files from folder that you has already been deleted from your repository then use below command:
$ git clean -f
- Now if two or more than one person is working on same repository then you need to create a branch and it will look like below:
$ git branch login
- Now you will see you are still in master branch so, you need to switch with login branch need to use below “checkout” command.
$ git checkout login
- Now you are in login branch. Here you can make changes in any file or create with “touch” command. The change in login branch doesn’t affect the master branch.
- To merge the login repository change into master branch, you need to go into master branch and run “merge” command.
$ git checkout git-test $ git merge login
- The merge processes override the files of master branch.
- Now to move files on github and get idea about how to use github, you need to create an account or need github login.
- Now use below command to check remote repository. If no repository found nothing will show.
$ git remote
- To create remote repository you need to use below command
$ git remote add tutorial the-link-of-your-github
- If you want to make main repository to origin then use below command:
$ git remote add origin the-link-of-your-github $ git clone username@host:/path/to/repository $ git remote add firstname.lastname@example.org:home (home will be git repository path)
- To push the code on github you need to use below command once you sure, your local server code is working fine.
$ git push –u tutorial master
- If you also want to push branch then use below like command:
$ git push –u tutorial login
- To add username to changes on repository you need to use below command:
$ git config -- global user.name victor
- Now, if you want to get code from github than you need to make dire on your folder suppose we create folder “chess” on desktop and go into chess folder.
$ mkdir chess $ cd chess
- Now add whole files of your github repository into chess folder to use below commands:
$ git init
$ git pull the-repository-path-urlfrom-repository
Hope the article will help you to make your own repository for files/code version control. We are sure, this tutorial is very helpful for those users who are looking git tutorial for windows.
We are assuming you have successfully completed your official task with reading our article and you will share the same guide with others to share our knowledge on git.
You can join us on telegram to get a more interesting git tutorial similar to the git version control article.