First Commit to GitHub

First Commit to GITHUB

GitHub commits pretty much follows by the user changes has been made on the branch. So here is the thing, you made the changes then you can stage them and at last you can push them origin branch. 

$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
ashish<=====> /d/Ashish/GIT/test (master)
$ vi test.txt
ashish<=====>/d/Ashish/GIT/test (master)

 

Now as we have added the file, we can stage the changes.

ashish<=====> /d/Ashish/GIT/test (master)
$ git add test.txt
warning: LF will be replaced by CRLF in test.txt.
The file will have its original line endings in your working directory
ashish<=====> /d/Ashish/GIT/test (master)
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
        new file:   test.txt

ashish<=====> /d/Ashish/GIT/test (master)


 Finally we are ready to commit the changes to local repository.

ashish<=====> /d/Ashish/GIT/test (master)
$ git commit -m "First commit."
[master ec27b91] First commit.
 1 file changed, 1 insertion(+)
 create mode 100644 test.txt
ashish<=====> /d/Ashish/GIT/test (master)

Push it origin

ashish<=====> /d/Ashish/GIT/test (master)
$ git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 300 bytes | 150.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/ashishtheapexian/test
   8dd0f05..ec27b91  master -> master
ashish<=====> /d/Ashish/GIT/test (master)
$

 

 All in one short:

$ git statusOn branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
ashish<=====> /d/Ashish/GIT/test (master)
$ vi test.txtashish<=====>/d/Ashish/GIT/test (master)
$ git add test.txtwarning: LF will be replaced by CRLF in test.txt.
The file will have its original line endings in your working directory
ashish<=====> /d/Ashish/GIT/test (master)
$ git statusOn branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)
        new file:   test.txt
ashish<=====> /d/Ashish/GIT/test (master)
$ git commit -m "First commit."[master ec27b91] First commit.
 1 file changed, 1 insertion(+)
 create mode 100644 test.txt
ashish<=====> /d/Ashish/GIT/test (master)
$ git push
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 300 bytes | 150.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/ashishtheapexian/test
8dd0f05..ec27b91 master -> master
ashish<=====> /d/Ashish/GIT/test (master)
$


Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *