Skip to content

Instantly share code, notes, and snippets.

@gunjanpatel
Last active August 27, 2021 14:03
Show Gist options
  • Save gunjanpatel/5972833 to your computer and use it in GitHub Desktop.
Save gunjanpatel/5972833 to your computer and use it in GitHub Desktop.
work with joomla git using terminal

Clone your forked repo in local.

Using Terminal

  1. For the very first time if you didn't configured remote repository then do it using this command.

     git remote add upstream git@github.com:joomla/joomla-cms.git
    
  2. Fetch changes from remote repository.

    git fetch upstream 
    
  3. Configure local working branch:

    git branch <new_local_branch_name> upstream/master
    git checkout <new_local_branch_name>
    

    or

    git merge upstream/master
    
  4. To Commit local branch

     git commit -a -m "Your commit message"
    
  5. Push you local branch on your Github Repository.

     git push origin <new_local_branch_name>
    

    If you want to push your local branch into new remote branch then

     git push origin <new_local_branch_name>:<remote_branch_name>
    

Discard uncommitted changes

    git checkout -- .
    
    git reset --hard

Applying a patch

  1. Download the patch to your working directory. Apply the patch with the following command:

     git apply -v [patchname.patch]
    
  2. To avoid accidentally including the patch file in future commits, remove it:

     rm [patchname.patch]
    

Remove *.orig files

    rm `find -name '*.orig' | xargs`
@wdburgdorf
Copy link

This used to work in the past. When I try now, "git fetch upstream" gives me the following error:

Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

EDIT: This works for me:
git remote add upstream https://github.com/joomla/joomla-cms.git

@gunjanpatel
Copy link
Author

It is because you are using SSH url and didn't added your public key in your Github settings https://github.com/settings/ssh. You can create SSH keys using https://help.github.com/articles/generating-ssh-keys/ guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment