How to use Github to access the same project files from different computers?

I work primarily on a desktop Mac, but also have a Mac laptop that I use when you are away from the office.

I want to access and work with my latest html, css, php and python files from any computer.

I thought Github is a way to do this, but I have a problem understanding the "stream" and I have RTFM! I don’t understand if I should first create a repository on Github, why when I try to “clone” something that it doesn’t magically end up on my local computer ... where there is a beautiful big red button with the word “sync” ...

... or should I just use the command line ONLY ...

So, if I start working on my desktop and create new files, then what correct steps can I use with git or Github (?) To put these files where they can be accessed from my laptop, and then have the files on did my laptop merge back into the repository? Github, so I can access these files from my desktop.

Thank you all for your answers and answers! The git workflow for my needs is now clear.

The workflow presented by wadesworld is concise and is the overview I need.

However, Michael Darrant’s teams populated this workflow specifically with command line directives — and I need that too.

steelclaw and uDaY answers and answers were important because I didn’t understand that it didn’t matter which repo I created first and, adding and doing locally, the first steps in my workflow were important.

In particular, steelclaw's answer to one of my answers answered the closure I needed, so I could learn more:

After initializing the repository, be sure to use 'add' and 'commit.' They will make the files the official version of the repository. After that, you need to use "push" to upload it to the remote repository. "

ilollar's resource , “Git for ages 4 and up,” is also worth a click, especially for people like me who are visual!

Thanks to everyone who really liked it!

+6
source share
6 answers

Do you want to manage file versions or just have access to the same files in both places?

It is a good idea to use version control as a developer, regardless of whether you write code or develop websites. But for this you must have a commitment to learn how version control systems work, since they all have some learning curve.

But, if you are not interested in this complexity and you just want to make sure that you have access to the latest version of your files, you are looking at the file synchronization operation, which can be much easier.

So which one do you want?

Edit: based on the answer, here is the model:

1) Create a repository on a working computer.

2) Create a repository with the same name in github.

3) Click on the repository on github

4) At home, make a git clone to pull out the changes you made.

5) Now that the repository exists in both locations, you can just press git before leaving work, and git pull when you get home, and vice versa when you move in the other direction.

+4
source

To answer the details of your question: I would go with Dropbox .
UbuntuOne is also good even for non-Ubuntu users, and of course Google drive is the (big) new block player.

They are compared as follows:

Service Free*1 NextLevel*1 NextLevel($)*2 Features Dropbox 2 50 $2.5O One Folder, best gui sync tools. UbuntuOne 5 20 $4.00 Multiple directories anywhere GDrive 5 25 $2.50 It Google. *1 GB *2 Cost per month 

To answer the title of your question:

If you want something more suitable for programmers, I would use git:

Install gitx first (linux readers, this gitg) as this is the most popular gui for git:

enter image description here

For the "flow", I can also refer you to my notation of various functions: What are the basic concepts of git, github, fork and branch. How does git compare to SVN?

Using gitx or gitg, a specific thread looks like this:

1) Make some changes to the files.

2) Use the "commit" tab of the tools to find out what has changed ("uninstalled"): enter image description here

3) Add the file by dragging it from the "unsteady" to the "delivered":

4) Give a commit message enter image description here

5) Commit the file. enter image description here

6) Then I click it on the remote in the command line using $ git push remote or I use gui by right-clicking and choosing the second wizard - see here: enter image description here

.

If I am sharing with others, I often need to do git pull in order to get and merge with other chnages) before you can do git push

The github part does init, push, and clone, but I would say that I just read these tutorials more than the SO question. Basically, I do this:

  • Configure repository locally in git:

git init
git add .
git commit "Initial commit"

Configure github:

Create a github repository using github ( https://help.github.com/articles/create-a-repo ) and then click on it a local repository, as in:

git click the initial wizard.

If the repository already exists in github, but not on your local computer, then you click on the remote link, and then on the terminal type git clone [paste here, for example. ctrl-v]

If you start with github:

  • Make changes to the code.
  • git pull - get the latest version in your repository and merge any changes
  • git add . Add all modified files
  • git commit -m "message"
  • git push # is the default initial wizard.

If at the end of the day you decide to go with something simple, such as Dropbox, you can use my referral link - http://db.tt/pZrz4t3k - to get a little more than the standard 2 GB. Using this, we get an additional 0.5 GB, however, which of these routes is up to you and your needs. I use all these services (git, github, UbuntuOne, Dropbox and googleDrive, so I do not recommend them over others - it depends on the needs).

+2
source

I would recommend using DropBox or Google Drive . They will allow you to do EXACTLY what you are trying to achieve, they are very user-friendly (and free [5 Gb, I think]).

They are automatically updated (if you have an Internet connection)

Just create a folder, put some files in it, and you leave.

+1
source

Since explaining how to use all of VCS in one answer is an overwhelming task, I can instead point you towards some very useful resources so that you understand and use Git:

  • Pro Git is a free online book (written with Git!) With easy language in all Git stuff.
  • GitHub Help - In the GitHub Help section, you can configure and use Git, not just with your applications. Very helpful.
  • Getting started with Git is a good tutorial that starts with Git.
  • Git For ages 4 and up - A fantastic video explaining the internal workings of Git with Tinker Toys. Not a good introduction to Git, but a great video to watch when you feel a little more comfortable.

Git may seem complicated or weird at first, but if you're looking for a good version control system, this is great.

However, if all you are looking for is a cloud service for synchronizing some files on multiple computers, as mentioned by others, Dropbox is the way to go.

+1
source

I use Github as a "hub" git to exchange ready-made codes. (And Git for version control)

And Dropbox to synchronize files between different computers and mobile / tablets to manage files.

http://db.tt/EuXOgGQ

They serve different purposes for me. Both are good!

0
source

Git is an advanced and fairly sophisticated versioning tool. If you feel brave, you can try installing the command line tool, however I recommend using a graphical client, in particular SourceTree. http://www.atlassian.com/software/sourcetree/overview

You need to clone your repository or initialize a new one. To connect to your repository, you need to know the URL and possibly the username and password for your repository. You also need to specify a valid name for the repository.

There are several steps to updating files: first, you need to add changes to the directory. The source tree can do this automatically. Then you need to commit the changes. This basically confirms the changes and signs them with a comment. To download them, you need to use push and select the correct remote repository. If you want to update the local repository, you will need to use pull and select the correct remote repository again.

However, for your purposes, it seems that Dropbox could be better because it is automatically updated and very simple. If you don't need the advanced version control that git provides (e.g. branching, merging with many users), then this seems like the best option for you. https://www.dropbox.com/

0
source

Source: https://habr.com/ru/post/917727/


All Articles