Saving files to GitHub


#1

Was wondering, if you’re typing and want to save within Atom (which is GitHub), instead of to your desktop, and the file goes to a github folder, is it private? Meaning, who can see the files within your own github folder? just you, or can anyone in the github community? Also what do “Staged Changes” “Unstaged Changes” and “Commit message” mean?
As you can tell i’m not a coder and am a newbie. But I love Atom bc it’s cool and it’s not MS Word.
Thanks!


#2

I can only recommend reading more about Git before you start using it. Back when I did, I found the git-scm.com extremely helpful (I had only minor experience with SVN, another version control system, before).

To answer your question. You typically initialize a Git repository locally. When you want to host the repository on GitHub (or Bitbucket), you will then have to create a remote repository on their side. In that process, you can specify whether the repository is private or public. Also, take note that on GitHub, you need a payed account to get private repositories. Only when both sides, local and remote, are set up you can “link“ them. From then on all committed changes in your code can be pushed to the remote end.


#3

Ah, thanks! I appreciate it. I will check out the link and learn more about Git.
So the folder I have with Git is locally hosted?


#4

Atom assumes that you use git, because Atom was made by people who use it all the time, including people paid directly by GitHub which was founded to modernize this rugged, hard-to-use tool. If you use both Atom and GitHub, you can use most features of git through intuitive graphic interfaces in the editor and browser, but neither is reliant on the other in any way.

I think that you are imagining git to be more like BitTorrent or DemonSaw, where a peer-to-peer link is formed and access is granted automatically, within certain limits. With git, there is no automated sharing of information. The git tool can read git repositories on the Internet and it can make repositories on the local computer. I have a laptop running Windows and a Raspberry Pi. If I want to upload new code to my Pi, I can set the Pi as a remote in git and use the git tool to send a push instruction to the Pi, which will check that I have permission to do so and then let me in. The folder on my machine is then copied to the folder on the Pi, as well as any new information about commits made since my most recent push. Nothing will be public unless you push it to a public repository.


#5

Ah okay. I have never used Git before. I’d heard of it but had never participated in the community at all, and cannot anyway since I do not code. I cannot commit anything. Only my lack of knowledge.
I was led to Atom by someone at the forefront of decentralization whom I admire and who mentioned it on a podcast. I do not understand Git and I only .01% understand Atom. But I am drawn to Atom because of its customization, hackability, and its light years’ distance from any other text editor and bloatware.
Thank you for clarifying that Atom does not share publicly files unless I specify it to push to a public repository.
And thanks for your reply! It cleared things up for me, put my mind at ease about it not being peer-to-peer. Cheers!


#6

Git can be useful for synchronizing files for all sorts of projects. Writing a book? You could make a branch for one ending and a branch for another ending, then compare their differences line-by-line. It is designed in a way that discourages most non-programmers from using it, but it’s potentially useful for everyone.


#7

Hey, that’s fantastic! I hadn’t considered branches, for comparative purposes when writing: that’s something that could prove very useful. I am a writer but not writing a book right now. I wonder how many non-programmers who are writers use Git. I’ll look up on Discuss if there are others in my boat. I do find Git and atom somewhat intimidating but at the same time friendly and fascinating.


#8

Also what are branches? (sorry)


#9

Git records the individual changes that are part of each commit. Say you have a repo with commits A, B, and C. A is the initial state and everything after that is remembered as a relative change to what was before it. Now you want to create a branch to do separate work on a specific feature or chapter. You create a branch and then edit files and make commit D. You can keep adding to the core repo and have your changes reflect on the branch, and you can decide that you want to merge the branch back in and have commit D be a part of your main project.

I don’t really use branches. I’m a dabbler and they’re kind of extraneous to what I do, and I’m a little worried that I might do a lot of work in a branch and then forget about it existing if I have to shelve the project for a few months.


#10

Thanks a lot. I appreciate you taking the time to explain these things to me.


#11

No problem. Since you’re interested, it’s worth mentioning that GitKraken is a graphical git client with beautiful design and a highly visual interface. It’s worth cloning a large repo (like Atom) just to take a look at how GitKraken displays the complicated net of information that makes up a git repo used by many different people.