An Article on GIT & GITHUB
Sivamuthuraja Varalakshmi Sakthivel
Data Processing Specialist at Sharp Mission Service Pvt. Ltd.
1. What is the difference between pushing and pulling?
The pushing sends the recent commit history from your local repository up to GitHub and the pulling grabs any changes from the GitHub repository and merges them into your local repository.
2. How to initialize a new git repository (Describe all the steps)?
To create a new repo, we'll use the git init command. git init is a one-time command we use during the initial setup of a new repo. Executing this command will create a new .git subdirectory in our current working directory. This will also create a new main branch.
3. What is the use of git clone and how to use it?
git cloning is generally a one-time operation. Once a developer has obtained a working copy, all version control operations are managed through their local repository.
git clone <repo url>
git clone is used to create a copy or clone of remote repositories. You pass git clone a repository URL. Git supports a few different network protocols and corresponding URL formats.
4. How to ignore some files/folders from pushing?
We can use .gitignore to select what you don't want to push it up to git server. Just put . gitignore to your root folder and add ./assets/* to this file.
5. What do you mean by Branch?
A branch represents an independent line of development. The git branch command lets we create, list, rename, and delete branches. It doesn't let we switch between branches or put a forked history back together again. For this reason, git branch is tightly integrated with the git checkout and git merge commands.
Which branch should be used to keep deployment-ready code?
In GitHub, the main branch contains our production-ready code. The other branches, the feature branch, should contain work on new features and bug fixes and will be merged back into the main branch when the work is finished and properly reviewed.
Create a new branch called development from the main branch.
$ git branch development
Check out one more branch deployment from the previous branch.
$ git checkout development
$ git checkout -b development
Push different data into both branches.
$ git push -u <remote> development
$git checkout develop
Merge data from both branches to the main branch.
git merge feature/login
RPA Consultant | Deputy Manager | UiPath |
3 年Great information.
Keep it up!