Git - Github Flashcards
Git is a
version control system
Files in the working directory can have 2 states:
tracked and untracked
Tracked files can have 3 states:
Modified, unmodified and staged
Why do we create new branches?
for any modifications on the project, adding new features for example
Can we create new features directly on main branch?
No, we create new branches and merge them to main when sure that there are no bugs
Github is a
version management web service
The command to create a local repository is:
git init
The commands to push your modifications to github are:
git add -> git commit -> git push (remember to push to your branch and not to main branch!)
To clone a repository locally, I will use the command:
git clone
To avoid pushing files with sensitive information, I need to add the file name to:
.gitignore file
The command to create a new branch is:
git branch
The command to change branch is:
git checkout
The command to create and switch to a new branch is:
git checkout -b
The command to delete a branch is:
git branch -D
The command to see the history of your repository is:
git log