Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.61 KB

File metadata and controls

48 lines (30 loc) · 1.61 KB

Git and GitHub — My Notes

What Git is and why it exists

Git helps you track files as you work. Also, it gives you access to history of changes, what changed and who changed what.

It helps team to work collaboratively without the need to compare work manually.

Without it, work would have been slower, and tracking every changes and who changed what would have been impossible.

The six core concepts

Repository

A place like a cloud where files are kept and history of a file can be viewed.

The Commit

A saved snapshot of your work.

The staging area

A place where your work are kept prior to being committed

Branch

A folder containing your files or work.

Merge

Merging the content of a file with another.

Remote

A place that serves as a cloud storage

The commands I use most

  • git add
  • git commit
  • git checkout
  • git branch
  • git push
  • giti pull

Merge conflict

When a particluar line in the same file is edited by two or more people causes merge conflic.

It is resolved by checking the file where the conflict has occured. And edit the files. The file contains three line markers. The arrow-like shape pointing to the left (indicating the main file) and arrow-like shape pointing to the left (indicating the file merging into the main file). These two are then separated by a dash-like lines. Edit means you keep what you want in the file and delete what you don't want in the file. This solves the merge conflict. Then you add and commit the file.

What surprised me most

It's trivial though. You can see all the branches in a folder and which branch you're on by running just "git branch".