Git Push to GitHub
HTML
CSS
JAVASCRIPT
SQL
PYTHON
PHP
BOOTSTRAP
HOW TO
W3.CSS
JQUERY
JAVA
MORE
SHOP
COURSES
REFERENCES
EXERCISES
×
HTML and CSS
Learn HTML Learn CSS Learn Bootstrap Learn W3.CSS Learn Colors Learn Icons Learn Graphics Learn SVG Learn Canvas Learn How To Learn SassJavaScript
Learn JavaScript Learn jQuery Learn React Learn AngularJS Learn JSON Learn AJAX Learn AppML Learn W3.JSProgramming
Learn Python Learn Java Learn C++ Learn C# Learn R
×
HTML
HTML Tag Reference HTML Browser Support HTML Event Reference HTML Color Reference HTML Attribute Reference HTML Canvas Reference HTML SVG Reference HTML Character Sets Google Maps ReferenceCSS
CSS Reference CSS Browser Support CSS Selector Reference Bootstrap 3 Reference Bootstrap 4 Reference W3.CSS Reference Icon Reference Sass ReferenceJavaScript
JavaScript Reference HTML DOM Reference jQuery Reference AngularJS Reference AppML Reference W3.JS ReferenceProgramming
Python Reference Java Reference
×
Exercises
HTML Exercises CSS Exercises JavaScript Exercises SQL Exercises PHP Exercises Python Exercises jQuery Exercises Bootstrap Exercises Bootstrap 4 Exercises Java Exercises C++ Exercises C# Exercises R Exercises MySQL Exercises NumPy Exercises Pandas Exercises Git ExercisesGit Tutorial
Git HOME Git Intro Git Get Started Git New Files Git Staging Environment Git Commit Git Branch Git Branch MergeGit and GitHub
GitHub Get Started GitHub Edit Code Pull from GitHub Push to GitHub GitHub Branch Pull Branch from GitHub Push Branch to GitHub GitHub Flow GitHub PagesGit Contribute
GitHub Fork Git Clone GitHub Send Pull RequestGit Exercises
Git Push to GitHub
Push Changes to GitHub
Let's try making some changes to our local git and pushing them to GitHub.
Example
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
<link
rel="stylesheet" href="bluestyle.css">
</head>
<body>
<h1>Hello
world!</h1>
<div><img src="img_hello_world.jpg" alt="Hello World from
Space" style="width:100%;max-width:640px"></div>
<p>This is the first file
in my new Git Repo.</p>
<p>This line is here to show how merging works.</p>
<div><img src="img_hello_git.jpg" alt="Hello Git"
style="width:100%;max-width:640px"></div>
</body>
</html>
Commit the changes:
Example
git commit -a -m "Updated index.html. Resized image"
[master e7de78f] Updated index.html. Resized image
1 file changed, 1 insertion(+), 1 deletion(-)
And check the status:
Example
git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
Now push our changes to our remote origin:
Example
git push origin
Enumerating objects: 9, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 16 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 578 bytes | 578.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To https://github.com/w3schools-test/hello-world.git
5a04b6f..facaeae master -> master
Go to GitHub, and confirm that the repository has a new commit:
Now, we are going to start working on branches on GitHub.
×
Report Error
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com
×
Thank You For Helping Us!
Your message has been sent to W3Schools.
W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.
While using W3Schools, you agree to have read and accepted our terms of use,
cookie and privacy policy.
Copyright 1999-2021 by Refsnes Data. All Rights Reserved.
W3Schools is Powered by W3.CSS.
Copyright 1999-2021 by Refsnes Data. All Rights Reserved.
W3Schools is Powered by W3.CSS.
