You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- to start a repository (am i in the right place on my computer? make a folder):
In a terminal, i'll jump to my user folder to start.
then i should go into the right folder where i keep my projects (eg./Users/ME/projects).
If it's an existing project i want to add git to, ill go into that sub-folder.
if its not an existing project, i should make a folder for my new project in the right folder, in my projects folder.
then i initialise git:
cd
cd projects
mkdir MY_NEW_PROJECT
cd MY_NEW_PROJECT
git init
- to check if i've accidentally made a git repository in the wrong folder:
- to delete a git repository i've accidentally made in the wrong folder:
- to download an existing repository (am i in the right place on my computer? don't make a folder):
what's up
- to check whats happening in git right now:
- to check which branch i'm in:
commits
- to add something to my shopping basket (add to staging area):
- to save my current work (make a commit):
- why I should't type git add .:
- what a commit message should contain:
- how often i should commit my work:
- reasons to commit my work:
- to check i saved my work before going a commit:
look for the black/white circle in the tab of any open files Visual Studio Code! That means they're unsaved.
looking around
- to see all the commits:
- to see where I have been in terms of travelling between commits:
- to compare the current commit to another commit:
- to travel to another commit:
- reason that i can't sometimes switch to a different commit or do a pull:
⭐ feature branches (git flow collaboration)
- to start making a feature (new branch):
- to continue making a feature after lunch break (rebase):
- to finish making a feature (rebase, push, pr):
- how often to merge a feature branch with main branch:
rebase issues
- why i use rebase instead of merge:
- some reasons and commands that cause a conflictto happen:
- what is happening during a rebase conflict in simple words:
- the steps to do during a rebase:
remotes
- to check where git is pushing code to (list all remotes):
other cool tricks
- to hide a file from git and ignore it forever ( so it never goes on github ):
- instead of diffing every changed line of code, show only filenames of files that changed: