Git

Yiğit Oğuz

Software Architect

11.07.2018

Related Digital Tech Talk

What is version control?

Version control systems are software that help you track changes you make in your code over time. As you edit to your code, you tell the version control system to take a snapshot of your files. The version control system saves that snapshot permanently so you can recall it later if you need it.

What is Git?

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
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 Basic

Every time you save your work, Git creates a commit. A commit is a snapshot of all your files at a point in time. If a file has not changed from one commit to the next, Git uses the previously stored file.

Branches

Each developer saves changes their own local code repository. As a result, you can have many different changes based off the same commit. Git provides tools for isolating changes and later merging them back together. Branches, which are lightweight pointers to work in progress, manage this separation. Once your work created in a branch is finished, merge it back into your team’s main (or master) branch.

Files&commit

Files in Git are in one of three states: modified, staged, or committed. When you first modify a file, the changes exist only in your working directory. They are not yet part of a commit or your development history. You must stage the changed files you want to include in your commit (you can omit files that you wish to commit separately). The staging area contains all changes that you will include in your next commit. Once you’re happy with the staged files, commit them with a message describing what changed. This commit becomes a part of your development history.

Benefits to Git

  • Simultaneous Development
  • Faster Releases
  • Built-in integration
  • Strong community support
  • Git works with your team
  • Pull requests
  • Branch policies

Initial Commit

git config --global user.name "*user name*"
git config --global user.email "*mail*"
git clone *repo uri*
cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin *repo uri*
git push -u origin master

Exercises..

Made with Slides.com