This is a normal fear every beginner face before going to use this super easy 'Git and Github'.
What is Git?
Git is a version control system that's lets you manage and keep track of your source code history.
(Now in more simple words its moreover used as a command in your system ...so do not worry much ).
What is version control:- It is a system that records changes to a file or set of files over time so that you can recall specific versions later.(In simple words, if you change/add something to your file's data ,it keeps both ones , the previous as well as updated file).
What is Github?
Github is a cloud based hosting service that lets you manage git repositories.
you will on your full speed with the first part...
Repositories - It is just a file location,where you store all files connected to your project (you can call it 'project's file folder').
Commit - Basically this is a command , used to run on the power shell or command prompt.
~what it will do- It is used to save changes to the local repository (local means on your own laptop, p.c. or any other system you are using).
Push - This is how you transfer commits from local repository to a remote repository (remote is located on the github, which ultimately store your files online.)
Clone - this generally copy the remote repositories to local repositories (it includes all available public repositories present over the internet. Yes, you can copy them and learn a lot).
Fork - It generally copy others repository to your Github, now you can use them without disturbing the original repository.
Fetch - Getting latest changes from online repository without merging them in.
Branch - It is a temporary sub-folder (you can add them again using merge).
Merging - It takes changes from one branch and applies them to another (done through pull request or command line).
well, it's my particular scenario, but they are very useful in many situations, specifically in the collaboration time.
Set up a Git repository and perform basic Git operations:-
git --version
git config --global user.name "Your Name"
-To configure your email to be used by Git, type the following at the prompt:
git config --global user.email <your email address>
-You can check your default Git global configuration, you can type the following at the prompt:
git config --list
Set up a folder as a Git repository
git init
-Type the following at the prompt to check your Git repository's status:
git status
-To add files to the staging area of your Git repository, type:
git add .
git commit -m "first commit"
Push your commits to the online repository
-At the prompt, type the following to push the commits to the online repository:
git push -u origin master
Clone an online Git repository to your computer
-To clone an online repository to your computer, type the following at the prompt:
git clone <repository URL>
Use of Git and Github
- Pushing tool:- You can simply put your code, your effort, your practice projects over the Github and showcase your skills, your work. (Now this is the part I like the most, its fun).
- Version control system:- Every open source project's first approach is toward git, which ultimately manage by Github. Specifically manage the git repositories.
- For Collaboration:- Now on a big extent, it allows groups of developers to collaborate on same document which is basically a source code of some project , also without overriding each other's work.
- You also get hosting with Github, that's also one more interesting area of it.
(Now, my friend do not worry much about it, its also not that tough, so first know and focus on the basics, because everything is quiet easy).
8888
ReplyDelete