Skip to content

Instantly share code, notes, and snippets.

@mcmatrix
Forked from CristinaSolana/gist:1885435
Last active September 17, 2019 14:05
Show Gist options
  • Save mcmatrix/c19d3dd3a92d7a32f0eae4619663736e to your computer and use it in GitHub Desktop.
Save mcmatrix/c19d3dd3a92d7a32f0eae4619663736e to your computer and use it in GitHub Desktop.

Revisions

  1. mcmatrix revised this gist Sep 17, 2019. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -44,4 +44,8 @@ To set the flag, use following command:

    To remove it, use:

    git update-index --chmod=-x path/to/file
    git update-index --chmod=-x path/to/file

    Starting with Git 2.9, you can stage a file AND set the flag in one command:

    git add --chmod=+x path/to/file
  2. mcmatrix revised this gist Sep 17, 2019. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -37,11 +37,11 @@


    ###### 8. Set permissions to file
    According to official documentation, you can set or remove the "executable" flag on any tracked file using update-index sub-command.

    To set the flag, use following command:
    According to official documentation, you can set or remove the "executable" flag on any tracked file using update-index sub-command.
    To set the flag, use following command:

    git update-index --chmod=+x path/to/file
    To remove it, use:

    To remove it, use:

    git update-index --chmod=-x path/to/file
  3. mcmatrix revised this gist Sep 17, 2019. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -33,4 +33,15 @@
    git merge feature_branch
    git reset origin/master
    git add . --all
    git commit
    git commit


    ###### 8. Set permissions to file
    According to official documentation, you can set or remove the "executable" flag on any tracked file using update-index sub-command.

    To set the flag, use following command:

    git update-index --chmod=+x path/to/file
    To remove it, use:

    git update-index --chmod=-x path/to/file
  4. mcmatrix revised this gist Oct 27, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -27,6 +27,8 @@
    git merge --squash bugfix
    git commit
    or
    git commit --signoff
    or
    git checkout master && git pull
    git merge feature_branch
    git reset origin/master
  5. mcmatrix revised this gist Jun 30, 2018. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -20,4 +20,15 @@
    git fetch theirusername
    git checkout theirusername/theirbranch
    or create new branch mynamefortheirbranch
    git checkout -b mynamefortheirbranch theirusername/theirbranch
    git checkout -b mynamefortheirbranch theirusername/theirbranch

    ###### 7. Squashing Git Commits into one
    git checkout master
    git merge --squash bugfix
    git commit
    or
    git checkout master && git pull
    git merge feature_branch
    git reset origin/master
    git add . --all
    git commit
  6. mcmatrix revised this gist Jun 22, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -18,4 +18,6 @@
    ###### 6. Checkout from fork
    git remote add theirusername https://github.com/theirusername/reponame
    git fetch theirusername
    git checkout theirusername/theirbranch
    or create new branch mynamefortheirbranch
    git checkout -b mynamefortheirbranch theirusername/theirbranch
  7. mcmatrix revised this gist Jun 22, 2018. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -13,4 +13,9 @@
    git rebase master

    ###### 5. Update from remote.
    git pull
    git pull

    ###### 6. Checkout from fork
    git remote add theirusername https://github.com/theirusername/reponame
    git fetch theirusername
    git checkout -b mynamefortheirbranch theirusername/theirbranch
  8. mcmatrix revised this gist Jun 20, 2018. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,16 @@
    ###### 1. Clone your fork:

    git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

    ###### 2. Add remote from original repository in your forked repository:

    cd into/cloned/fork-repo
    git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
    git fetch upstream

    ###### 3. Updating your fork from original repo to keep up with their changes:

    git pull upstream master

    ###### 4. Replay your commits on top of the new commits from the destination branch so that the merge can be a ‘fast-forward’.

    git rebase master
    git rebase master

    ###### 5. Update from remote.
    git pull
  9. mcmatrix revised this gist Jun 20, 2018. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -10,4 +10,8 @@

    ###### 3. Updating your fork from original repo to keep up with their changes:

    git pull upstream master
    git pull upstream master

    ###### 4. Replay your commits on top of the new commits from the destination branch so that the merge can be a ‘fast-forward’.

    git rebase master
  10. mcmatrix revised this gist Jun 20, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    ## 1. Clone your fork:
    ###### 1. Clone your fork:

    git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

    ## 2. Add remote from original repository in your forked repository:
    ###### 2. Add remote from original repository in your forked repository:

    cd into/cloned/fork-repo
    git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
    git fetch upstream

    ## 3. Updating your fork from original repo to keep up with their changes:
    ###### 3. Updating your fork from original repo to keep up with their changes:

    git pull upstream master
  11. mcmatrix revised this gist Jun 20, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    ### 1. Clone your fork:
    ## 1. Clone your fork:

    git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

    ### 2. Add remote from original repository in your forked repository:
    ## 2. Add remote from original repository in your forked repository:

    cd into/cloned/fork-repo
    git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
    git fetch upstream

    ### 3. Updating your fork from original repo to keep up with their changes:
    ## 3. Updating your fork from original repo to keep up with their changes:

    git pull upstream master
  12. @CristinaSolana CristinaSolana revised this gist Feb 22, 2012. No changes.
  13. @CristinaSolana CristinaSolana created this gist Feb 22, 2012.
    13 changes: 13 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    ### 1. Clone your fork:

    git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

    ### 2. Add remote from original repository in your forked repository:

    cd into/cloned/fork-repo
    git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
    git fetch upstream

    ### 3. Updating your fork from original repo to keep up with their changes:

    git pull upstream master