0

I want to bring changes updated in online repository to my local repository. Here is what I have done:

I have a project and I've uploaded it on Git repository named as Android-app.

  1. I've done some work on this project at my office and uploaded changes on GitHub.

  2. I've reached my home and I've already cloned that repository (Android-app) to my laptop earlier.

Now, what I want is to bring online changes to my current repository on laptop without cloning again. How can I do that with Git bash?

Biffen
  • 6,249
  • 6
  • 28
  • 36
lss mesy
  • 59
  • 2
  • 8
  • `git fetch`, `git rebase`. Time to [RT*M](http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes), perhaps? – Biffen Apr 09 '15 at 06:15
  • 1
    ^ those and `git pull`. I’m surprised you managed to push your changes to your repository if you don’t know how to interact with remotes. – poke Apr 09 '15 at 06:19
  • telling any beginner to use ``git pull`` is asking for trouble – Sébastien Dawans Apr 09 '15 at 06:50
  • Yeah @ Sébastien Dawans..You've got me right..I am a beginner..:-) – lss mesy Apr 09 '15 at 07:35
  • @poke I had some idea about how to clone, connect to remote, upload you current changes to Remote etc. but i didn't have the idea of the asked question..but You guys are just Awesome to help out..:-) – lss mesy Apr 09 '15 at 07:38

1 Answers1

1

There is a simple command to do this job: The command is :

git pull 

or

git pull origin master

In the second command master is your branch name and origin is the remote name, place the branch name in which you are working instead of master. If you want pull changes from the current branch then first command is pretty enough.

Imran
  • 4,582
  • 2
  • 18
  • 37
  • `git fetch origin` and then `git pull` on your branches should do the same. Git fetch updates your repository head and Git pull fetches changes to your repository branch. – Lars Nielsen Apr 09 '15 at 07:24
  • Thanks @Imran and Lars Nielsen..That really helped me a lot !! – lss mesy Apr 09 '15 at 07:30