際際滷

際際滷Share a Scribd company logo
Version Control, You Git
Speaker:
Mr Mayur S Patil, Asst Prof, MITAOE.
Mr Sarup Banskota
Plan of Talk
¢ Birth of Git
¢ Why the hell should I use Git?
¢ Initialize the Git
¢ Got DNA, make clone
¢ Push Pull to Boss i.e. Github
¢ Experimenting with Branch
¢ Conclusions
¢ Assignments on Public Demand
Must Prerequisite
Come with two things:
On Ubuntu:
# apt-get install git
On CentOS/Fedora/Arch:
# yum install git
Account on github.com
Birth of Git
¢ Father of Git: Linus Torvalds
¢ Tired of Bitkeeper
¢ Features he wanted:
$ Take Concurrent Versions System (CVS) as an
example of what not to do; if in doubt, make the
exact opposite decision
$ Support a distributed.
$ Very strong safeguards against corruption, either
accidental or malicious
Why the hell should I use Git?
¢ Working on One PC
¢ Working on Two PC¨s
¢ Working on Server Machine
¢ Still fail´..?
So, why not use Git?
Initialize the Git
To start bike we require Fuel
Similarly to get started with Git, we have to
initialize it.
$ git init
Got DNA, make clone
As Human DNA makes clone of itself, so the Git
$ git clone https://github.com/ramlaxman/Fudcondemo.git
Add to Commit
When make change in file always check these
commands:
$ git status -s
$ git add ram.txt
$ git commit -m ^File Created ̄
Folder addition to Repo
$ mkdir samp-fold
$ cd samp-fold
Need one file for submission
$ touch ram.txt
$ cd ..
$ git add samp-fold/
$ git commit -m ^folder created ̄
Push Pull to Boss i.e. Github
Now ready to send your work.
¢ git push origin master
If it fails meaning ^Kuchh to gadabad hai ̄, for that Pata
Karo ki :
¢ SSH hain?
¢ Internet shuru hai?
like these type of issues.
SSH Procedure:
Just follow this awesome help link:
https://help.github.com/articles/generating-ssh-
keys/
Want to Bypass SSH?
Try this:
$ git push git@github.com:username/repo.git
for ex,
$ git push git@github.com:ramlaxman/Fudcondemo.git
Experimenting with Branch
Make a copy and work on it.
Like, Xerox of Important Paper.
In same manner, create duplicate of existing repository, you
have to create branch of it
$ git checkout -b new_branch
To switch
$ touch a2.txt
$ vi a2.txt
$ git add a2.txt
$ git commit -m ^a2.txt created ̄
$ git push origin master
Now go to web browser, checkout master branch you will
also find branch ^new_branch ̄
Switch back to master
$ git checkout master
and delete the branch again
$ git branch -d new_branch
A branch is not available to others unless you push the
branch to your remote repository
$ git push origin master
So for new branch, to complete changes in Updated on Git
Repo:
$ git checkout -b new_branch
$ touch a2.txt
$ vi a2.txt
$ git add a2.txt
$ git commit -m ^a2.txt created ̄
$ git push origin new_branch
Now, real part starts:
$ vi a2.txt // change some text in a2.txt
$ git status // to know status of updation and files to be send
$ git add a2.txt
$ git commit -m ^modified ̄
$ git status
$ git pull origin new_branch
$ git push origin new_branch
And you will see your file has been updated on the Git. Hurray!!
Conclusion
¢ Hope Basics are clear.
¢ You can push changes to your own repo.
¢ If any problem like serious buggy code has
push, so how to revert´...will be in set of
curiosity.

More Related Content

Version control, you git

  • 1. Version Control, You Git Speaker: Mr Mayur S Patil, Asst Prof, MITAOE. Mr Sarup Banskota
  • 2. Plan of Talk ¢ Birth of Git ¢ Why the hell should I use Git? ¢ Initialize the Git ¢ Got DNA, make clone ¢ Push Pull to Boss i.e. Github ¢ Experimenting with Branch ¢ Conclusions ¢ Assignments on Public Demand
  • 3. Must Prerequisite Come with two things: On Ubuntu: # apt-get install git On CentOS/Fedora/Arch: # yum install git Account on github.com
  • 4. Birth of Git ¢ Father of Git: Linus Torvalds ¢ Tired of Bitkeeper ¢ Features he wanted: $ Take Concurrent Versions System (CVS) as an example of what not to do; if in doubt, make the exact opposite decision $ Support a distributed. $ Very strong safeguards against corruption, either accidental or malicious
  • 5. Why the hell should I use Git? ¢ Working on One PC ¢ Working on Two PC¨s ¢ Working on Server Machine ¢ Still fail´..? So, why not use Git?
  • 6. Initialize the Git To start bike we require Fuel Similarly to get started with Git, we have to initialize it. $ git init
  • 7. Got DNA, make clone As Human DNA makes clone of itself, so the Git $ git clone https://github.com/ramlaxman/Fudcondemo.git
  • 9. When make change in file always check these commands: $ git status -s $ git add ram.txt $ git commit -m ^File Created ̄
  • 10. Folder addition to Repo $ mkdir samp-fold $ cd samp-fold Need one file for submission $ touch ram.txt $ cd .. $ git add samp-fold/ $ git commit -m ^folder created ̄
  • 11. Push Pull to Boss i.e. Github Now ready to send your work. ¢ git push origin master If it fails meaning ^Kuchh to gadabad hai ̄, for that Pata Karo ki : ¢ SSH hain? ¢ Internet shuru hai? like these type of issues.
  • 12. SSH Procedure: Just follow this awesome help link: https://help.github.com/articles/generating-ssh- keys/
  • 13. Want to Bypass SSH? Try this: $ git push git@github.com:username/repo.git for ex, $ git push git@github.com:ramlaxman/Fudcondemo.git
  • 14. Experimenting with Branch Make a copy and work on it. Like, Xerox of Important Paper. In same manner, create duplicate of existing repository, you have to create branch of it $ git checkout -b new_branch
  • 15. To switch $ touch a2.txt $ vi a2.txt $ git add a2.txt $ git commit -m ^a2.txt created ̄ $ git push origin master
  • 16. Now go to web browser, checkout master branch you will also find branch ^new_branch ̄ Switch back to master $ git checkout master and delete the branch again $ git branch -d new_branch
  • 17. A branch is not available to others unless you push the branch to your remote repository $ git push origin master
  • 18. So for new branch, to complete changes in Updated on Git Repo: $ git checkout -b new_branch $ touch a2.txt $ vi a2.txt $ git add a2.txt $ git commit -m ^a2.txt created ̄ $ git push origin new_branch
  • 19. Now, real part starts: $ vi a2.txt // change some text in a2.txt $ git status // to know status of updation and files to be send $ git add a2.txt $ git commit -m ^modified ̄ $ git status $ git pull origin new_branch $ git push origin new_branch And you will see your file has been updated on the Git. Hurray!!
  • 20. Conclusion ¢ Hope Basics are clear. ¢ You can push changes to your own repo. ¢ If any problem like serious buggy code has push, so how to revert´...will be in set of curiosity.

Editor's Notes

  • #3: While we are talking about Git and its birth, meanwhile all participants please those who installed git yet; please install for Debian based: (Debian, Ubuntu) # sudo apt-get install git RPM based (Red Hat, Fedora, CentOS, Archlinux) # sudo yum install git