Git -For beignner (Tutorial) -- Part3

Git Checkout

To delete the git branch, can do following :

[rprasad@vm hello-world]$ git checkout master
Switched to branch 'master'
[rprasad@vm hello-world]$ git branch
* master
  test
[rprasad@vm hello-world]$ git branch -D test
Deleted branch test (was 86fab07).
[rprasad@vm hello-world]$ git branch
* master
[rprasad@vm hello-world]$


Committing File:

[rprasad@vm hello-world]$ git commit README.md
[test e8c727b] testing
 Committer: RAJESH PRASAD <rprasad@vm.localhost>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 4 insertions(+)


NOTE: You'll be asked to supply a commit message. 


To check git commit, check log:

[rprasad@vm hello-world]$ git log
commit e8c727b47d825021664ac6b03ea98f62a3f3dcbb
Author: RAJESH PRASAD <rprasad@vm.localhost>
Date:   Mon May 15 14:18:28 2017 +0800

    testing

commit 86fab076a56467e65c2d04819ff5ea2738dbb26c
Author: RAJESH PRASAD <rajeshp2408@users.noreply.github.com>
Date:   Thu May 4 14:00:28 2017 +0800

    Initial commit


Now, push the changes to Git:

[rprasad@vm hello-world]$ git push origin test
Username for 'https://github.com': rajeshp2408
Password for 'https://rajeshp2408@github.com':
Counting objects: 5, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 304 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/rajeshp2408/hello-world.git
 * [new branch]      test -> test
You have new mail in /var/spool/mail/rprasad


Verify the push, by going to git and check the branch:



Comments

Popular posts from this blog

Xmanager RHEL 6 xclock :command not found -- Resolved

Racktable on ubuntu installation

RPM Tit-Bits ;-)