Jump to content

GitHub Related

Nano Adam

Currently I use Google Drive to sync the files that I use with Web Development, I use two-three different devices during the day. I am looking for the Git command that would let me achieve similar results. 

 

Thanks

Link to comment
Share on other sites

Link to post
Share on other sites

cd <directory_path> 

git init

git remote add origin <your github repo address>

git commit -m <commit message>

git push -u origin master 

 

create a separate branch if you have teammates who each work on their own stuff. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

Git has no concept of "live sync" since everything is done in commits. Ie, like save games.

 

Save game would be a little useless if it saved every single second, just as having a commit for every 1 character change in code would be fairly useless.

Instead the Git workflow is more like "Okay, I've done part 1 of that thing I want to do, I'll commit now".

 

So you add a commit with some title like "Started implementation of feature 1 by adding X." and then push that up to your Git provider of choice (GitHub/GitLab/etc).

Your teammates then see the progress of you adding small logical chunks of the feature, rather than every tiny change where you accidentally typed string as strign and so on.

So you synchronise when you feel it is necessary with a commit then push, rather than all the time constantly.

 

It can take a bit of getting used to, but it becomes very easy very quickly.
Plus live sync would struggle or fail if you and someone else edited line 50 of the same file at the same time, whereas Git has plenty of built in ways of dealing with conflicts etc.

CPU: 6700k GPU: Zotac RTX 2070 S RAM: 16GB 3200MHz  SSD: 2x1TB M.2  Case: DAN Case A4

Link to comment
Share on other sites

Link to post
Share on other sites

In other words, my ultimate goal is that I create a new project on my laptop, then push/commit the changes to Github, then go on my desktop, then be able to open that exact project from github on Visual Studio Code, then work on it and commit then go back to my laptop and pickup where the desktop left off.

 

Basically, how would my desktop get the Github files that I worked on in my laptop.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, wasab said:

cd <directory_path> 

git init

git remote add origin <your github repo address>

git commit -m <commit message>

git push -u origin master 

 

create a separate branch if you have teammates who each work on their own stuff. 

You should do this anyway.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, ammar_code said:

In other words, my ultimate goal is that I create a new project on my laptop, then push/commit the changes to Github, then go on my desktop, then be able to open that exact project from github on Visual Studio Code, then work on it and commit then go back to my laptop and pickup where the desktop left off.

 

Basically, how would my desktop get the Github files that I worked on in my laptop.

 

 

Git pull

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

GitHub is not a VCS. The underlying git is a VCS. Don't use them as synonyms.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×