My Authors
Read all threads
$ git gud
> git: 'gud' is not a git command. See 'git --help'.

Here's why you should learn Git:
* Basics are pretty easy!
* (Almost) every developer team & job requires it
* Stop worrying about breaking your code
* because you can always revert back🙌

#100DaysOfCode #Git

🧵⬇️ Image
How to get started in a few tweets:

1. Download git git-scm.com/downloads
2. Use a terminal and navigate to your project
3. Run "git init"
4. Create a GitHub account github.com/join
5. Create a repo 👉 repo.new
6. git config --global user.name 'your name'
7. git config --global user.email 'your-github@email.com'
8. Follow the steps GitHub tells you (see image) Image
These commands are what you will use the most and are all you need to get started

1. git init (initialize repository)
2. git add <file> (add a file to index)
3. git status
4. git commit ("save" changes)
5. git push (push changes to GitHub)
6. git pull (download changes)
One that I use all the time is

git add .

If I want to add all the files in the current directory / folder so I can commit them

Some additional ones:
* git branch my-branch name (create a new branch)
* git checkout my-new-branch (change to a branch)

More info on these below
🛑 Don't want some files added to git?

Create a .gitignore file in the root of your project (note the . )

Then add the files or directories to that file like:

my_secret_directory/
favorite_developers.txt
*.zip

and it will ignore those files after you commit the gitignore
Branches allow you to work on a feature in isolation until it is finished

Run "git branch" and it will say you are on the "master" branch (default)

git branch my-new-feature
git checkout my-new-feature

Start committing/pushing for your new feature

See image (1 dot = 1 commit) Image
To "copy" those changes back into the master branch you can do:

git checkout master
git merge my-new-feature
git push

Here is an article on a branching strategy you could use, but it's not required. You can do whatever you want.

git-scm.com/book/en/v2/Git…
Want a more detailed explanation? @traversymedia has a great video on this topic!

I even referenced it for this thread so I was sure I didn't forget something 😂

📽️🔗 Image
Additional topics you could read about later:
- Git is not the same as GitHub
- git stashing
- pull requests on GitHub
- code reviews on GitHub
- Forking on GitHub
- Using SSH with Git

Need help? Run "git --help" but Google is also your friend! We are developers after all 😁 Image
Fun fact: Git was invented in 2005 by Linus Torvalds, the same person who invented Linux! Image
</thread>

This is the end of the thread
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Eddy Vinck 👨‍💻 JavaScript

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!