You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,20 @@ learn-git!
13
13
* Once you create your repository, you'll need to connect that repository with your code on your computer.
14
14
* Create a folder called 'myProject' then inside that folder create a file called 'myName.js'. Add your name to that file and then save it.
15
15
* Now in your terminal navigate to your 'myProject' folder. Once inside that folder, type```git init```. You've just told your computer that you want git to watch the 'myProject' folder and keep track of any changes - basically making it so you can now run git commands inside of this folder.
16
-
* Now that you've initialized your 'myProject' folder, we need to tell your computer where the location of your github repository is. To do this you create what is called a remote. Basically we tell our computer 'Hey computer, I created this repo on github, when I push, I want my code to go to this github repo'. To do this, in your terminal type```git remote add origin https://github.com/nameOfYourRepo.git``` with nameOfYourRepo being replaced with what you named your repository. Now whenever you run```git push origin master``` your computer knows that origin is pointing to your repo you made on github and it pushes your changes there.
17
-
* Now that our remote is set up. You'll need to add your files to the staging area, commit your files to be ready for pushing, then push your files. The process I always take is one that looks like this.
18
-
*```git status``` --> this will show me what files have been changed. I want to make sure not to add any files to github that I don't want there
19
-
*```git diff``` this will show me the actual code that has been changed. Again, I want to make sure I don't push anything to github that shouldn't be there
20
-
* If everything looks good```git add nameOfMyFile.js``` I add my file(s) to the 'staging area'
21
-
*```git commit -m "The sentence I want associated with this commit message"``` which tells my computer 'hey, next time code is pushed to github, take all of this code with it.
22
-
*```git push origin master``` and MAGIC. My code is now on github.
16
+
* Now that you've initialized your 'myProject' folder, we need to tell your computer where the location of your github repository is. To do this you create what is called a remote. Basically we tell our computer 'Hey computer, I created this repo
17
+
on github, when I push, I want my code to go to this github repo'. To do this, in your terminal type```git remote add origin https://github.com/nameOfYourRepo.git``` with nameOfYourRepo being replaced with what you named your repository. Now whenever you run```git push origin master``` your computer knows that origin is pointing to your repo you made on github and it pushes your changes there.
23
18
24
19
###Step 3: Push your code to github
25
-
* Follow the steps I did above in order to get your new code on your computer up to your github repository.
20
+
Now that our remote is set up. You'll need to add your files to the staging area, commit your files to be ready for pushing, then push your files.
21
+
22
+
The process I always take is one that looks like this:
23
+
24
+
1.```git status``` --> this will show me what files have been changed. I want to make sure not to add any files to github that I don't want there
25
+
2.```git diff``` this will show me the actual code that has been changed. Again, I want to make sure I don't push anything to github that shouldn't be there
26
+
3. If everything looks good```git add nameOfMyFile.js``` I add my file(s) to the 'staging area'
27
+
4.```git commit -m "The sentence I want associated with this commit message"``` which tells my computer 'hey, next time code is pushed to github, take all of this code with it.
28
+
5.```git push origin master``` and MAGIC. My code is now on github.
29
+
26
30
* If all goes well, check your github repository for your new code.