USA I

Un concurso organizado por Museum of Modern Art en Nueva York en el año 1940, en el cual sorprenden los diseños ganadores de Charles Eames y Eero Saarinen. Los Eames eran un equipo de marido y mujer…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Guide to Git and GitHub..!

Complete guide about git and GitHub.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -
Q1. What exactly do u mean by Git and Github?
Ans. Git is a popular control system which is installed and it maintains all your local system and gives you a self-contained record if your ongoing programming versions. Git is easy to learn and has a tiny footprint with lightning-fast
performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows. Git is written in CC, Perl, Tcl, Python. The original author is
Linus Torvalds. The best part about Git is that you don’t need an internet connection to access it and it is free of cost and easy to use.
GitHub is designed as a Gut repository hosting service. Git repository hosting is
an online database that allows you to keep track of your work and shares your
Git projects outside the local server. It is popular for open source projects.
If the server is failed then the data is not lost since it is saved in your local repository. The parent organization of GitHub is Microsoft Corporations.
It was founded in 2008 and the CEO of GitHub is Nat Friedman. Github is written in Ruby. Github has a total of 40 million users by Aug 2019. Founder of GitHub is
Tom Preston-Werner, P.J Hyett, Chris Wanstranth, Scott Chacon.

Q2. Why Github is so popular in most of the projects?
Ans.
a. The Largest shared repository- Pushing the project to a shared, public repository makes it instantly discoverable for those 28M users.
b. Easy Version Control- It tracks all the changes made to your code and who makes them.
c. Immensely Powerful Community-itHub is an open-source platform, and the community is
that fills it up.
d. Secure Cloud storage-The platforms protect all your data for you: protects code branches,
verifies commit signing, controls access.

Q3.What are the other platforms similar to Github?
Ans.
a.GitLab
b.Google cloud source repositories c.AWS Code commits d.Apache Allura

Q4. Q1 How git workflow works? What are the different stages of a git the project as commit, add?
Ans.
1. Working directory — Workspace.
2. Index ie stage
3. Local Repository ie Head
4. Remote Repository
There is one central repository.
Each developer clones the repo,
works locally on the code,
Modifies and makes the changes as required
Commit the changes using command commit -a with changes
and push it to the central repository
for other developers to pull and use in their work.

Q5.Is it possible to do a git commit before git add?
If you have made any changes? Explain why?
Ans. No, because according to the process
first, we have to add the file and then commit changes to it
After making the changes we will add them using “git add .”
and then we can commit it using (commit -a).

Q6. Why is git diffused?
Ans. git diff is used to track the difference between the changes made on a file. This command shows all the
changes which are done. Diff command takes two inputs and reflects the differences between them. These inputs don’t need to be filed only.
It can be branches, working trees, commits, and more.

Q7.Can we leave the commit message as blank?
Ans. git commit -a — allow-empty-message -m msg
It is a valid request, commit can have no message at all.

Q8.What do you mean by fork and clone?
Ans. Fork — We create a copy of the main repository of a project source code to our own Github profile. In this we can do any changes without affecting the main source of the project. Fork repository makes a connection between our fork and the original repository and us
can go back to the original project using a pull request.
We do clone to make our repository on our local computer.
We cannot pull the changes from the original repository when cloning.

Q9.What are branches in Github? What is PR?
Ans. When we create a repository, then the main linear list of commits are on the master branch. We can makes changes in master as well as in a new branch. All the branches are independent of each other.
After editing we can commit the changes in the branch directly or create
a new branch.
PR stands for pull requests.
It lets others know about the changes we have pushed to a branch in a repository of GitHub. Once the pull request is open we can discuss and review it before the changes are merged into the main brach.

Q10. Can we delete the master branch if not why? How can we delete the master branch?
Ans. Yes we can delete the master branch.
First delete the master in your local clone. We can make a new branch
first and delete the master.
We cannot delete the master branch directly from GitHub instead first we
will make GitHub look for our new branch and then delete the master branch.
To do so we will push the new branch then set the new branch to GitHub default
branch then go to main Github page for your forked repository and click on
admin button and you are done its set as default.

a. Git fails to start the merge when there are changes in the working directory or staging area of the current project.
b. Git fails during merge — conflict in the current local branch and branch being
merged.

Q12. Can we have 200 different branches other than the master?
Ans. Yes we can have 200 different branches other than the master.

Q13. What is the difference between git branch -d and git branch -D?
Ans. git branch -d is the command used to delete a branch. The branch
must be fully merged in its upstream.
“git branch -D is the shortcut command for — — delete — — force”

Enjoy..!!
Github is fun to use and I would like to thank my mentors in guided me
through this whole process.
Thank you
Regards
Priya Aggarwal

Add a comment

Related posts:

Word2Vec in Practice for Natural Language Processing

Before diving into Word2Vec we have to know what actually word embedding is and why is it actually required. So let's get started. Word embeddings are a type of word representation that allows words…

Blockchain technology is about to change the game industry

The application of blockchain technology to the game industry has caused many changes in the game field, such as the replacement of virtual currency with cryptocurrency, the confirmation of digital…

Datajoo on pearltrees

Pearltrees refers to itself as “a place for your interests”.[8] Functionally the product is a visual and collaborative curation tool[9][10][11][12] that allows users to organize, explore and share…