Dev 18. Git (Commit, Branch, Merge, Pull, Push, Pull Request, Remote Repo)

Jeongmin Jamie Shin
2 min readDec 21, 2020

Git is a distributed ‘version-control system’ for tracking changes in any set of files. Originally it is designed for coordinating work among programmers collaborating on source code during development. Its goal is speed, data integrity, and support.

Commit is recorded change to a file or set of files. Before we make a commit, we must tell Git what files we want to commit. This is called staging and uses the add command. We add files to a staging area, and then we commit the files that have been staged.

Branches and Merging lets you work with other developers more easily by letting us branch out from the original source code. For example, when we need to work on a new feature for a website, we can create a new branch and starting working on in. If we get a request to make a rapid change within today, then we switch back to the master branch, make it change, and push it live. Then we can switch back to new feature branch and finish the work. When we are done, we merge the new feature branch into the master branch and both new feature and rapid change are kept.

When we merge two branches, it can sometimes get a conflict. Git has a way to handle the conflict, so we can see both sets of. changes and decided which we want to keep.

Pull Requests are a way to discuss changes before merging them into our codebase. A developer makes changes on a new branch and want to merge them into the master. They can create a pull request to notify us to review the code. We can discuss and decide if we want to merge it or not.

Pull fetches and downloads content from a remote repository and immediately update the local repository to match that content. Merging remote upstream changes into our local repo is a common in Git-based collaboration.

Push is used to upload local repository content to a remote repository. It is how you transfer commits from our local repo to a remote repo

Github and Bitbucket (Remote Repositories) are online repository and it provides us with a centre where we can upload changes or download changes from others. After Github or Bitbucket set up, we upload (push) files and revision history to it. After other makes changes to a remote repositories, we can download (pull) the changes into our local repositories.

--

--

Jeongmin Jamie Shin
0 Followers

EN/KO/IT, Web development, Cooking, Reading, Business