0

I am doing a project on website building in my ubuntu system.I am quite new to it.And my project is maintained by Git repository.

My problem is that I dont know how to update my project codes to the latest by using the Git repository system.So,I want a detailed step 2 step way to do this.

I am using Ubuntu 12.04.Please dont mind asking any further details.

Any valuable answer would be highly appreciated.

Thank you.

nerd
  • 78
  • 1
  • 10

2 Answers2

1

Personally, I prefer to rebase as it brings lineal history:

$ git fetch && git checkout your-branch && git rebase origin/your-branch

Or you can merge - depending how you want your history look like:

$ git fetch && git checkout your-branch && git merge origin/your-branch

The simplest method would be:

$ git pull

But I would not recommend it as it might bring you some troubles. Actually, it fetches and merges code - like two commands at once.

More info could be found here: What is the difference between 'git pull' and 'git fetch'?

Read on tutorials: Top 10 Git Tutorials for Beginners

Community
  • 1
  • 1
Roman Newaza
  • 11,405
  • 11
  • 58
  • 89
0

Merging is preferred over rebasing for the following reasons:

  • fewer conflict resolutions
  • when someone uses your project as a submodule, you don't ruin their history
  • you can't guarantee that the same changes would have been attempted from a new starting point.

You can read up on my work-flow here: http://dymitruk.com/blog/2012/02/05/branch-per-feature/

For a great book on git, I would recommend: http://progit.org/book

Once you understand the Directed Acyclic Graph (DAG) it will all make sense. My friend recently said that to understand git and how to get something accomplished you must "be the graph".

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141