Skip to content

Instantly share code, notes, and snippets.

@Jessmaxim303
Last active May 13, 2019 03:29
Show Gist options
  • Save Jessmaxim303/fdf9cb38ba551d102449cf6c5a041f77 to your computer and use it in GitHub Desktop.
Save Jessmaxim303/fdf9cb38ba551d102449cf6c5a041f77 to your computer and use it in GitHub Desktop.
Jesse Maxim's guide to git

Beginners Guide to Git

gitimage

Why are Git and GitHub so important for programmers and developers?

Git is an amazing VCS tool that allows you to track changes to files and large projects over time. It also has the ability to link up with GitHub and be made into a powerful collaboration tool for developers. Let's go over the basic rules and concepts to get started with Git and GitHub.

In order for you to get Git to set up an empty Git repository you will need to perform the git init command while in the project you want to attach it to. Then you will need to add git to the file you want to track.

Next it's time to add your file to the staging area by using git add <your_project_name.txt>. Once in the staging area your file will remain untill you are ready to move to your local repository.

Now it's ready for you to take a snapshot of your project and move it to your local respository by using git commit -m 'Initial commit' Always remember to make the first character a capital letter.

Last you will be pushing it to your the repository by using the git push command.

To get your file to your GitHub repository is an easy thing do to just follow add, commit and push.

  • ADD
git add <your_project_name.txt>
  • COMMIT
git commit -m 'Initial commit'
  • PUSH
git push

Now we are going to link your Github repositoriy to your already working local. This is super easy.

  1. First visit github.com/your_project_name.txt
  2. In the top right hand corner you'll see a + click that and select a New Respository.
  3. Scroll down to Create Repository, and then to push an existing repository from the command line.
  4. Last Cut and Paste that in your terminal and Github will ask for your username and password.

Now that you are linked you can git push to your remote repository and even pull requests to merge with the original repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment