Skip to content

Working and Branching with Git

Sebastian Scherer edited this page Jun 4, 2014 · 4 revisions

HowTo work with git

  1. Checkout the repository git clone https://github.com/C-CINA/2dx.git
  2. Add your changes to the source code
  3. Commit your changes with git commit -a -m "commit message". This will commit the changes to your local repo, not the repo on the server!
  4. Share your changes with the other developers with git push

HowTo create a new branch

  1. Create a local branch with git checkout -b feature1
  2. Implement the new feature
  3. Push to remote with git push origin feature1
  4. Merge the branch back
  5. Delete the feature branch locally git branch -d feature1
  6. Delete the feature branch remotely git push origin :feature1

HowTo checkout a remote feature branch

  1. git fetch origin
  2. git checkout -b feature1 origin/feature1