version_control:git_basics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
version_control:git_basics [2020/09/25 20:32] – [Basic operations] mithat | version_control:git_basics [2024/04/17 21:53] (current) – [Branching and merging] mithat | ||
---|---|---|---|
Line 2: | Line 2: | ||
===== Clarification ===== | ===== Clarification ===== | ||
- | | + | <WRAP center round tip b60%> |
+ | **Git** ≠ **GitHub** | ||
+ | </ | ||
- | ===== Getting started with git ===== | + | There are many Git repository hosting services, and [[https://github.com/|GitHub]] wasn't even the first. Some popular alternatives are [[https://gitlab.com/|GitLab]] and [[https://bitbucket.org|Bitbucket]]. But there are many others. Also, Git is not the only VCS in use today. It was originally created independently of any company |
- | * [[https://git-scm.com/downloads|Install git]] | + | |
- | * [[https://confluence.atlassian.com/bitbucket/ | + | |
- | * [[https://help.github.com/ | + | |
- | * You will need to know how to open an appropriate command line interface (i.e., " | + | |
===== Basic operations ===== | ===== Basic operations ===== | ||
Line 23: | Line 21: | ||
<WRAP center round tip 90%> | <WRAP center round tip 90%> | ||
- | Use the '' | + | Use the '' |
</ | </ | ||
===== Branching and merging ===== | ===== Branching and merging ===== | ||
- | * A git repository has a default branch called **master**. | + | * A git repository has a default branch called |
* To create a new branch: <code bash>git branch branch-name</ | * To create a new branch: <code bash>git branch branch-name</ | ||
* Switch to an existing branch: <code bash>git checkout branch-name</ | * Switch to an existing branch: <code bash>git checkout branch-name</ | ||
Line 33: | Line 31: | ||
* Merge changes in another branch into the current branch: <code bash>git merge branch-name</ | * Merge changes in another branch into the current branch: <code bash>git merge branch-name</ | ||
* Delete a branch that you're not currently in: <code bash>git branch -d branch-name</ | * Delete a branch that you're not currently in: <code bash>git branch -d branch-name</ | ||
+ | |||
+ | <WRAP center round tip 90%> | ||
+ | The new '' | ||
+ | </ | ||
===== Ignoring files ===== | ===== Ignoring files ===== | ||
* To make git ignore some files in your project, create a '' | * To make git ignore some files in your project, create a '' | ||
# Ignore specific files | # Ignore specific files | ||
- | nastyfile.txt | + | my-passwords.txt |
- | another-nastyfile.docx | + | banking-info.docx |
# Ignore compiled file(s) | # Ignore compiled file(s) | ||
Line 47: | Line 49: | ||
foo/* | foo/* | ||
</ | </ | ||
+ | |||
+ | <WRAP center round tip 80%> | ||
+ | The file name must be '' | ||
+ | <code bash> | ||
+ | touch .gitignore | ||
+ | </ | ||
+ | </ | ||
===== GUI interface ===== | ===== GUI interface ===== |
version_control/git_basics.txt · Last modified: 2024/04/17 21:53 by mithat