This is an old revision of the document!


Everyday Git Usage

This page describes a very simple git workflow that can be used with most projects.

Clone the repository
git clone [email protected]:some-user/some-repo.git

Create a branch
git checkout -b branch_name

Update from the remote master
(Do this often if you're working on a branch for a while)
git fetch
git rebase origin/master

Committing and pushing after you've made your changes
git add filenames.c
git commit
git push origin branch name

Submit a pull request on github
- Go to the github repository, click on 'branches', and click on “new pull request”
- Have someone review your code. If new changes need to be made, make them.
- Click on 'squash and merge'

Switch back to the master branch
git checkout master
git fetch
git rebase origin/master

git clone - Clone a repository into a new directory. Details
git fetch - Download objects and refs from another repository. details
git rebase - Reapply commits on top of another base tip. Details
git add - Add file contents to the index Details
git commit - Record changes to the repository. Details
git push - Update remote refs along with associated objects. Details

  • training/everyday_git_usage.1474436486.txt.gz
  • Last modified: 2021/09/19 21:59
  • (external edit)