vcs:gitfaq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vcs:gitfaq [2018/08/07 01:39] – Minor typos carusogabrielvcs:gitfaq [2021/04/06 08:00] (current) – rename master to main sergey
Line 5: Line 5:
 ===== Introduction ===== ===== Introduction =====
  
-The PHP git repositories are at http://git.php.net/ There is a github mirror at https://github.com/php+The PHP git repositories are at https://github.com/php
  
 PEAR repositories are in https://github.com/pear.  This FAQ does not discuss PEAR.   PEAR repositories are in https://github.com/pear.  This FAQ does not discuss PEAR.  
Line 33: Line 33:
 ===== Clone URL and Push URL ==== ===== Clone URL and Push URL ====
  
-Read only urls are +Clone/Push URL
-   +
-  http://git.php.net/repository/php-src.git +
-  git://git.php.net/php-src.git +
- +
-Clone/Push URL (always requires password)+
  
-  https://git.php.net/push/php-src.git+  https://github.com/php/php-src.git
  
 SSH URL SSH URL
      
-  git@git.php.net:php-src.git +  git@github.com:php/php-src.git
  
 Hint: set the push URL (https or git@) with (see also, Quickstart below) Hint: set the push URL (https or git@) with (see also, Quickstart below)
Line 67: Line 62:
 Add a list of merged commits to the autogenerated commit message Add a list of merged commits to the autogenerated commit message
   $ git config merge.log true   $ git config merge.log true
- 
-Add an alias for checkout. you can now use git co to checkout a branch 
-  $ git config alias.co checkout 
  
 Enable colored output for git commands Enable colored output for git commands
   $ git config color.ui true   $ git config color.ui true
- 
-Allow you to omit the "--no-ff" switch in merge.  Requires Git 1.7.6 or later. 
-  $ git config --add merge.ff false 
  
 Avoids pushing other branches by accident when using a plain "git push". Git will only push the branch you are on by default. Note this will prevent the "Multiple working copies workflow" steps (shown below) from working: Avoids pushing other branches by accident when using a plain "git push". Git will only push the branch you are on by default. Note this will prevent the "Multiple working copies workflow" steps (shown below) from working:
Line 101: Line 90:
 ===== Quickstart ===== ===== Quickstart =====
  
-  $ git clone http://git.php.net/repository/php-src.git+  $ git clone https://github.com/php/php-src.git
   $ cd php-src   $ cd php-src
-  // if you want to push throuh https 
-  $ git config remote.origin.pushurl https://git.php.net/push/php-src.git 
   // update repository   // update repository
   $ git pull --rebase   $ git pull --rebase
Line 115: Line 102:
 Always commit to the oldest branch. If your commit is good for PHP 5.6 and PHP 7.0, commit to PHP 5.6. Then merge your commit. Always commit to the oldest branch. If your commit is good for PHP 5.6 and PHP 7.0, commit to PHP 5.6. Then merge your commit.
  
-  $ git clone http://git.php.net/repository/php-src.git+  $ git clone https://github.com/php/php-src.git
   ....   ....
   $ git branch --track PHP-5.6 origin/PHP-5.6   $ git branch --track PHP-5.6 origin/PHP-5.6
Line 124: Line 111:
   $ git commit Zend/zend.c   $ git commit Zend/zend.c
   $ git checkout PHP-7.0   $ git checkout PHP-7.0
-  $ git merge --log PHP-5.6+  $ git merge PHP-5.6
   $ git checkout master   $ git checkout master
-  $ git merge --log PHP-7.0+  $ git merge PHP-7.0
   $ git push   $ git push
  
Line 138: Line 125:
  
   cd    cd 
-  git clone git@git.php.net:php-src.git+  git clone git@github.com:php/php-src.git
  
 or if you're behind a firewall: or if you're behind a firewall:
  
   cd   cd
-  git clone https://git.php.net/repository/php-src.git+  git clone https://github.com/php/php-src.git
   cd ~/php-src   cd ~/php-src
-  git config remote.origin.pushurl https://git.php.net/push/php-src.git/ 
  
 ==== Recommended: Git worktree ==== ==== Recommended: Git worktree ====
Line 244: Line 230:
   cd ~/php-5.6  # if you're not here yet   cd ~/php-5.6  # if you're not here yet
   git checkout PHP-5.6   git checkout PHP-5.6
-  git merge --no-ff <mybranch>+  git merge <mybranch>
   git diff origin/PHP-5.6 # review changes   git diff origin/PHP-5.6 # review changes
  
Line 251: Line 237:
   cd ~/php-7.0   cd ~/php-7.0
   git checkout PHP-7.0   git checkout PHP-7.0
-  git merge --no-ff PHP-5.6+  git merge PHP-5.6
   git diff origin/PHP-7.0   git diff origin/PHP-7.0
  
   cd ~/php-src   cd ~/php-src
   git checkout master   git checkout master
-  git merge --no-ff PHP-7.0+  git merge PHP-7.0
   git diff origin/master   git diff origin/master
      
Line 280: Line 266:
  
 ===== Using SSH ==== ===== Using SSH ====
-  * Add your SSH key to your profile on http://master.php.net/manage/users.php +  * Add your SSH key to your profile on https://main.php.net/manage/users.php 
     * you can set multiple keys in separate lines     * you can set multiple keys in separate lines
     * if you get the "the ssh key doesn't seem to have the necessary format" error, check that your key has your email address at the end (it is mandatory currently to have an email address there)     * if you get the "the ssh key doesn't seem to have the necessary format" error, check that your key has your email address at the end (it is mandatory currently to have an email address there)
   * Wait 10 minutes   * Wait 10 minutes
-  * Clone from or set new repository to git@git.php.net:php-src.git+  * Clone from or set new repository to git@github.com:php/php-src.git
     For web git repositories, don't forget the first slash or you'll get an error when committing ("access denied", or "there may be no repository at the given path") :     For web git repositories, don't forget the first slash or you'll get an error when committing ("access denied", or "there may be no repository at the given path") :
-  git config remote.origin.pushurl git@git.php.net:/web/qa.git +  git config remote.origin.pushurl git@github.com:php/php-src.git
  
  
Line 305: Line 291:
  
 ===== Commit Mails ===== ===== Commit Mails =====
-Commit mails are send to the appropriate mailinglist (e.g. php-cvs@lists.php.net for commits to php-src).+Commit mails are send to the appropriate mailing list (e.g. php-cvs@lists.php.net for commits to php-src).
 For every push a mail with an overview about the pushed changes will be mailed. Follow up mails for every commit will be sent. They will include the For every push a mail with an overview about the pushed changes will be mailed. Follow up mails for every commit will be sent. They will include the
 patch, a list of changed paths and the commit message. The list of changed paths will also be the subject. patch, a list of changed paths and the commit message. The list of changed paths will also be the subject.
Line 311: Line 297:
 ====== FAQ ====== ====== FAQ ======
   - **Can I checkout a subdirectory only?** Yes, but it's a rather new and experimental feature. See [[http://vmiklos.hu/blog/sparse-checkout-example-in-git-1-7]]   - **Can I checkout a subdirectory only?** Yes, but it's a rather new and experimental feature. See [[http://vmiklos.hu/blog/sparse-checkout-example-in-git-1-7]]
-  - **Rebase What?** Read [[http://blog.experimentalworks.net/2009/03/merge-vs-rebase-a-deep-dive-into-the-mysteries-of-revision-control/]] +  - **Rebase What do you mean?** Read [[https://www.atlassian.com/git/tutorials/merging-vs-rebasing]] and [[https://randyfay.com/content/simpler-rebasing-avoiding-unintentional-merge-commits]] 
-  - More questions? Just add them, I will try to answer them. +  - (Awaiting answerWhat about commits that should not be merged upwards (say, only for 5.3)? Should you still merge them but make it so no changes actually take place? Otherwise, it will the next person merging that will have to deal with the conflict (or worse, the changes will be merged when they shouldn't have been) 
-  - What about commits that should not be merged upwards (say, only for 5.3)? Should you still merge them but make it so no changes actually take place? Otherwise, it will the next person merging that will have to deal with the conflict (or worse, the changes will be merged when they shouldn't have been)+ 
 +If you have questions, please send them to internals@lists.php.net.
vcs/gitfaq.1533605955.txt.gz · Last modified: 2018/08/07 01:39 by carusogabriel