Thursday, September 24, 2015

The Hell That is Git




Recently, (as I said in my IRC blogpost) I have started to get a little bit more social in the Linux world. One of the 'requirments' or 'strong recommendations' from working with this group of people, is sharing some of your work! The most commonly used resource, where even most businesses put their (open) source code, is Github.

Although, this is true, the documentation for Github and the level of knowledge of some people don't quite work out. While it is quite obvious for the more technologically inclined, that Github can be controlled in a plethora of ways other than one set way, this isn't shown for the newcomers. So, hopefully I can help all of those searching for the 'right way' out.

1. Get it!
In order to use the tool, you have to first have an account of the Github.com webpage, as well as the git package for your distro or operating system (sudo apt-get git or for Windows and OSX download from the website)

2. Make a folder!
So, what do you want to share? My first commit to Github was (and still is) my config files for my desktop! There are many ways you can go about uploading files already on your hardware, but I'm too lazy to worry about ease, and I prefer to know I have control over what I have and havent updated to Git. So I made a “dotfiles” folder and put copies of all my config files in there..

3. Exist!
Great title, right? This step, all you have to do is make a new repository, (be smart, be future-wise name the computer's folder the same as the repository) then after you make the repository, you should reach a page like this.

After you reach this page, cd into the folder you made for the repo, then execute the first command below “..or push and existing repository from the command line”. Once that is done, cp or mv all the folders and files you want to see inside of this repository. The excecute the command “git add .” which will let git know what's new. After that, execute git commit, which will either automatically read all the changes, or will ask you to edit a text file to uncomment changed files and folders. THEN you can execute the second command “git push -u origin master” it will ask you for your account information, and then everything will be uploaded! Voila!

As soon as I learn how to use some of the other tools alongside git, I will post a little bit here about it.



No comments:

Post a Comment