Regex Software Services-Master Class on Git & GitHub
Suraj Pawar (スラジパワール)
Technical Services Trainee at Fujitsu | Full Stack Developer | Java | JDBC | SpringBoot | Bootstrap | Angular14 | Angular Material | MySQL | Github | DevOps | Artistry Unleashed
Two reasons why you should get to know about Git and GitHub:
1>Because it come in handy when you work alone ad is indispensable when you work in a team.
2>Because it will be difficult for you to get a job as a front-end developer (or a programmer without knowing the version control system (Git is the most popular version control system).
Reality – We Broke Something:
We have overwritten, deleted it, we need access to the version that had such and such a solution. we need to easily identify a certain version of the project.
Tracking projects, many versions, and the ability to find yourself in chaos. Compare version and changes. Quick and safe restoration of older version s pr their fragments-all this is a very important element of working with the project.
Reality - Cooperation in a Team:
If two to several hundred (more people ) work on one project, we have teamwork and numerous problems in the area of how to do it efficiently and safely.
What to do so that one project does not wait to get the current version to work ,how to resolve conflicts and combine different versions. How to documents, work how to work independently, but still on one project.
The Solution is a Version Control System:
Version control systems try to solve these and other problems, The most popular version control system is Git. It is a solution that helps you to track the changes and combine the code from many people working on the project. It is a tool that allows you to create repositories.
OR
VCS is used to manage the project in time. It creates the history of the project, allows many people to collaborate and combine their work.
“the repository is a concept that includes the project files and the change history record. The important concepts of git.”
Git: It is a distributed version control system.it is the most popular version control system. It is liked, Efficient, fast and very complex.it is free and open-source software.
GitHub: The most popular Platform for remote creation and storage of a project repository (based on Git ). It also serves as a backup and provides the additional tools to help you work on a project in a group.
What is the difference between pushing and pulling?
Pushing:
1>command used to the pushing of the local repository data into a remote repository.
2>After a local repository has been modified a push is executed to share the modifications with remote team members or in other words we can say that simply,
3>Git push is used to upload the changes in files from the local Machine to the Git hub.
Syntax: git push <remote_name> <branch_name>
Pulling:
1>command is used to fetch and merge changes from the remote repository to the local repository.
2>The pull command is a combination of two commands, the git fetches command followed by the git merge command.
3>Git fetches command downloads content from the required remote repository, while Git merge command combines multiple sequences of commits into a single branch OR we can say that git pulls to download latest changes from git hub to Local Machine.
Syntax: git pull <remote_name> <branch_name>
How to initialize a new git repository?
Step 1: Create a directory to contain the project.
Step 2: Go into the new directory
Step 3: Type git init.
Step 4: Write some content in that.
Step 5: Type git add to add the files.
Step 6: Type git commit.
What is the use of Git clone and how to use it?
Cloning:
1>It is a process of creating an identical copy of a Git Remote Repository to the local machine. When we clone a repository, all the files are downloaded to the local machine but the remote git repository remains unchanged.
2> Making changes and committing them to your local repository (cloned repository) will not affect the remote repository that you cloned in any way. These changes made on the local machine can be synced with the remote repository anytime the user wants.
How does Cloning in Git works?
1>A lot of people want to set up a shared repository to allow a team of developers to publish their code on GitHub / GitLab / BitBucket etc. A repository that is uploaded online for collaboration is called an Upstream Repository or a Central Repository.
2>A central repository indicates that all the changes from all the contributors pushed into this repository only. So, this is the most updated repository instance of itself. Sometimes this is often called the original repository.
Step 1: On Github, navigate to the main page of the repository.
Step 2: Above the list of files, click Code.
Step 3: Copy web URL.
Step 4: Open Git Bash.
Step 5: Change the current working directory to the location where you want the cloned directory.
Step 6: Type git clone, and then paste the URL you copied earlier.
Step 7: Press Enter to create your local clone.
How to ignore some files/folders from pushing?
.Gitignore certain files and directories that is, exclude them from being tracked by Git by creating one or more .gitignore files in your repository.
.gitignore typically contains a listing of files and/or directories that are generated during the build process or at runtime.
When a file or directory is ignored, it will not be:
1>tracked by Git
2>reported by commands such as git status or git diff
3>staged with commands such as git add -A
What do you mean by Branch?
1>A branch in Git is a way to keep developing and coding a new feature or modification to the software and still not affecting the main part of the project. We can also say that branches create another line of development in the project.
2>The primary or default branch in Git is the master branch. also as you start making commits, you given a master branch that points to the last point commit you made. every time you commit, the master branch pointer moves forward automatically.
Which branch should be used to keep deployment-ready code?
Production Branch(Develop)
Create a new branch called development from the main branch.
git checkout -b development (Now, we are in the master branch and created development branch)
Check out one more branch deployment from the previous branch.
git checkout development (checkout in development branch from master branch)
git checkout -b development (Now, we are in the development branch and created deployment branch)
Push different data into both branches.
git push (Push data in development branch)
git checkout deployment (Checkout in deployment branch from a development branch)
git push (Push data in deployment branch)
Merge data from both branches to the main branch.
git checkout master (checkout in master branch from deployment branch)
git merge development (Merge development branch with master branch)
git merge deployment (checkout in deployment branch from master branch)
?Thank you...
Building Grip! Software Engineer | Ex - Chatgen.ai
3 年Great going.. Keep learning and growing
Good and keep learning!
Design Engineer @rocketium, Thinking Jobs Differently at rightfit.so
3 年Thanks for sharing, Really insightful ??