<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Git</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>Recent changes to Git</description><atom:link href="https://sourceforge.net/p/forge/documentation/Git/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 21 Jan 2025 19:37:48 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/forge/documentation/Git/feed" rel="self" type="application/rss+xml"/><item><title>Git modified by Dave Brondsema</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v42
+++ v43
@@ -134,59 +134,12 @@

 The webhook payloads and signature verification method are documented at https://forge-allura.apache.org/p/allura/wiki/Webhooks/

-#Accessing the repository via the shell
+# Server-side configuration
+Please [open a support ticket](https://sourceforge.net/p/forge/site-support/new/?private=true) for assistance with server-side configuration like:

-Direct access to the bare repository is also available via [SSH], when logged into the shell, it will be available at:  
-
-`/home/git/p/PROJECTNAME/REPO.git/`
-
-Note that the directory is mounted during the shell creation, if you create a new repository while an existing shell session is still active, use the `shutdown` command on the shell and start a new session.
-
-## Allowing force pushes
-
-Use the above instructions to access your repository via an SSH shell.  Then edit the `config` file and set `denyNonFastforwards = false`.
-
-For more control over what branches or what users can do a force push, you will need to set up a custom server-side hook.
-
-## Server Hooks
-
-Direct access to the repository can be used to install [custom git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) server-side.  Use our [Shell Service] access and then go to the `/home/git/p/PROJECTNAME/REPO.git/hooks` directory.
-
-Note, however, that a *`post-receive`* hook is used for site-integration, if this hook is changed, the code browser view may no longer automatically update. Instead, you should save any post-receive hook as *`post-receive-user`* instead, and it will be called by the default post-receive hook.
-
-If you need to re-create the default post-receive hook, the template for that is: 
-
-~~~~
-#!/bin/bash
-# The following is required for site integration, do not remove/modify.
-# Place user hook code in post-receive-user and it will be called from here.
-curl -s https://sourceforge.net/auth/refresh_repo/p/PROJECTNAME/REPOSITORY/
-
-DIR="$(dirname "${BASH_SOURCE[0]}")"
-if [ -x $DIR/post-receive-user ]; then
-  exec $DIR/post-receive-user
-fi
-~~~~
- 
-### Email notification hook
-
-To send emails to a mailing list, add this line (including the `. `) to your `post-receive` (or `post-receive-user`) hook file:
-
-```
-. /usr/share/git-core/contrib/hooks/post-receive-email
-```
-
-You'll also need to add some lines to your existing `config` file (in the repo.git dir, not in the hooks dir):
-
-```
-[hooks]
-   mailinglist = "My List Name &amp;lt;mylist@example.com&amp;gt;"
-   emailprefix = "[git] "
-```
-
-And also update the `description` file from "Unnamed repository..." to something like "project-name/repo-name".
-
-Then emails will be sent to the specified list for each commit.
+- allowing force pushes
+- email notification hooks
+- custom git hooks

 # Changing Default Branch
 If you want to change your git repo's default branch ( say from `master` to `develop` or `main`), you can do it!  First, make sure your new branch is created already.  Then:
@@ -202,7 +155,7 @@
 git push origin --delete &amp;lt;old-branch-name&amp;gt;
 ```

-If you get an error like the following, then make sure to run steps #4 &amp;amp; #5 above to update the server repository.
+If you get an error like the following, then [open a support ticket](https://sourceforge.net/p/forge/site-support/new/?private=true) for assistance.

 ```shell
 $ git checkout main
&amp;lt;/old-branch-name&amp;gt;&amp;lt;/mylist@example.com&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Tue, 21 Jan 2025 19:37:48 -0000</pubDate><guid>https://sourceforge.netdc9a37dcfda16f9869c76b6e2aa8a43d7e751a14</guid></item><item><title>Git modified by Dave Brondsema</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v41
+++ v42
@@ -189,12 +189,10 @@
 Then emails will be sent to the specified list for each commit.

 # Changing Default Branch
-If you want to change your git repo's default branch ( say from `master` to `develop` or `main`), you can do it! 
-1. Go to your SF git tab.
+If you want to change your git repo's default branch ( say from `master` to `develop` or `main`), you can do it!  First, make sure your new branch is created already.  Then:
+1. Go to your SourceForge git tab.
 2. Click the "Admin - " drop-down
-3. Click "Set default branch" and enter a new branch name
-4. Use our [Shell Service] to access your git repo on the server.  Change directory to  `/home/git/p/PROJECTNAME/REPO.git`
-5. Run `git symbolic-ref HEAD refs/heads/&amp;lt;branch name=""&amp;gt;` where `&amp;lt;branch name=""&amp;gt;` is the name of your new default branch (i.e. `main`)
+3. Click "Set default branch" and enter the new branch name

 ## Deleting `master` After Changing Default Branch

&amp;lt;/branch&amp;gt;&amp;lt;/branch&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Fri, 18 Aug 2023 16:38:48 -0000</pubDate><guid>https://sourceforge.net947e2f28a08c45f84b11a5fe5b94c7ff19074ba5</guid></item><item><title>Git modified by Dave Brondsema</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v40
+++ v41
@@ -193,10 +193,18 @@
 1. Go to your SF git tab.
 2. Click the "Admin - " drop-down
 3. Click "Set default branch" and enter a new branch name
+4. Use our [Shell Service] to access your git repo on the server.  Change directory to  `/home/git/p/PROJECTNAME/REPO.git`
+5. Run `git symbolic-ref HEAD refs/heads/&amp;lt;branch name=""&amp;gt;` where `&amp;lt;branch name=""&amp;gt;` is the name of your new default branch (i.e. `main`)

 ## Deleting `master` After Changing Default Branch

-If you want to delete your previous default branch (i.e. `master`) after changing your default, you can. However, the commands that normally do this will throw an error as shown below:
+If you want to delete your previous default branch (i.e. `master`) after changing your default, you can by running:
+
+```
+git push origin --delete &amp;lt;old-branch-name&amp;gt;
+```
+
+If you get an error like the following, then make sure to run steps #4 &amp;amp; #5 above to update the server repository.

 ```shell
 $ git checkout main
@@ -214,11 +222,6 @@
  ! [remote rejected] master (deletion of the current branch prohibited)
 error: failed to push some refs to 'ssh://USERNAME@git.code.sf.net/PATH/TO/GIT/REPO'
 ```
-
-To fix this and successfully delete your previous default branch:
-1. Access your git repo over [SSH].
-2. Once connected and inside the git repo directory, run `git symbolic-ref HEAD refs/heads/&amp;lt;branch name=""&amp;gt;` where `&amp;lt;branch name=""&amp;gt;` is the name of your new default branch (i.e. `main`).
-3. Now, from your local repo you should be able to run `git push origin --delete &amp;lt;old-branch-name&amp;gt;`.
 #Backups
 SourceForge.net performs routine backups for all of our servers and will restore from these backups in the event of catastrophic server failure. We encourage projects to make their own backups of Git data as that data restore can be performed by the project in the event of accidental data destruction by a member of the project team.

&amp;lt;/old-branch-name&amp;gt;&amp;lt;/branch&amp;gt;&amp;lt;/branch&amp;gt;&amp;lt;/old-branch-name&amp;gt;&amp;lt;/branch&amp;gt;&amp;lt;/branch&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Thu, 06 Jul 2023 14:42:11 -0000</pubDate><guid>https://sourceforge.netaf3326259df11f2512bf4f0848ae3e77641fd716</guid></item><item><title>Git modified by SourceForge Support</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v39
+++ v40
@@ -1,7 +1,7 @@
 [TOC]

 #What is Git?
-Git is a Source Code Management (SCM), a tool for software developers which supports collaborative development of software within a team, and the tracking of changes to software source code over time.
+Git is a Source Code Management (SCM) tool for software developers which supports collaborative development of software within a team, and the tracking of changes to software source code over time.

 Git is used by developers, and advanced users who need the very latest changes to the software (before releases occur). Software users generally do not need Git; typically they will download official file releases made available by the project instead.

@@ -16,7 +16,7 @@

 * All 1.6.x features of git are supported.
 * Developer (read/write) access is provided via ssh.
-* anonymous (read-only) access are provided via git's daemon protocol ("git://").
+* anonymous (read-only) access is provided via git's daemon protocol ("git://").
 * Several Git clients are supported, including:
    - The official git client (MS Windows, Mac OS X, Linux, BSD).
 * Existing repositories may be imported via a normal git push (since git is a distributed SCM).
@@ -75,7 +75,7 @@

 Note: - For all examples below, "PROJECTNAME" represents a SourceForge.net project UNIX name and "USERNAME" represents your SourceForge.net user account.

-Your project's Git repository will be completely empty at the start. If you have a local Git version older than 1.6.2, you won't be able to clone (pull) your remote repository while it is empty, so see below for how to set up a local repository to push your content to our servers.
+Your project's Git repository will be empty at the start. If you have a local Git version older than 1.6.2, you won't be able to clone (pull) your remote repository while it is empty, so see below for how to set up a local repository to push your content to our servers.

 ##How to create a new local repository

@@ -123,14 +123,14 @@

     $ git push origin master

-Note: The use of "origin master" prevents Git from complaining that the remote server has no branches in common with your local repository (which is true at the start when the remote repository is completely empty), and "master" is the default branch in Git.
+Note: The use of "origin master" prevents Git from complaining that the remote server has no branches in common with your local repository (which is true at the start when the remote repository is empty), and "master" is the default branch in Git.

 After the first push, you will be able to use the simpler "git push" to push the master branch to our "origin" server.

 Once that is done, you will be able to browse your newly-committed content via the web, clone the repository via either read-only or read/write access methods, push more check-ins, etc.

 # Webhooks
-Webhooks are available for all code repositories. To configure a webhook, go to your repository and in the left menu expand the Admin section. Then click the "Webhooks" link. You can create and update your webhooks there.
+Webhooks are available for all code repositories. To configure a webhook, go to your repository, and in the left menu expand the Admin section. Then click the "Webhooks" link. You can create and update your webhooks there.

 The webhook payloads and signature verification method are documented at https://forge-allura.apache.org/p/allura/wiki/Webhooks/

@@ -152,7 +152,7 @@

 Direct access to the repository can be used to install [custom git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) server-side.  Use our [Shell Service] access and then go to the `/home/git/p/PROJECTNAME/REPO.git/hooks` directory.

-Note however, that a *`post-receive`* hook is used for site-integration, if this hook is changed, the code browser view may not longer automatically update. Instead, you should save any post-receive hook as *`post-receive-user`* instead, and it will be called by the default post-receive hook.
+Note, however, that a *`post-receive`* hook is used for site-integration, if this hook is changed, the code browser view may no longer automatically update. Instead, you should save any post-receive hook as *`post-receive-user`* instead, and it will be called by the default post-receive hook.

 If you need to re-create the default post-receive hook, the template for that is: 

@@ -189,14 +189,14 @@
 Then emails will be sent to the specified list for each commit.

 # Changing Default Branch
-If you want to change your git repo's default branch ( say from `master` to `develop` or `main`) , you can do it! 
+If you want to change your git repo's default branch ( say from `master` to `develop` or `main`), you can do it! 
 1. Go to your SF git tab.
-2. Click the "Admin - " drop down
+2. Click the "Admin - " drop-down
 3. Click "Set default branch" and enter a new branch name

 ## Deleting `master` After Changing Default Branch

-If you want to delete your previous default branch (i.e. `master`) after changing your default, you are able to. However, the commands that normally do this will throw an error as shown below:
+If you want to delete your previous default branch (i.e. `master`) after changing your default, you can. However, the commands that normally do this will throw an error as shown below:

 ```shell
 $ git checkout main
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SourceForge Support</dc:creator><pubDate>Fri, 20 Aug 2021 21:44:15 -0000</pubDate><guid>https://sourceforge.net35a0f1cfcc873660004e061c78a265eacd134f58</guid></item><item><title>Git modified by Dillon Walls</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v38
+++ v39
@@ -196,7 +196,7 @@

 ## Deleting `master` After Changing Default Branch

-If you want to delete your previuos default branch (i.e. `master`) after changing your default (advanced users only), you are able to. However, the commands that normally do this will throw an error as shown below:
+If you want to delete your previous default branch (i.e. `master`) after changing your default, you are able to. However, the commands that normally do this will throw an error as shown below:

 ```shell
 $ git checkout main
@@ -217,9 +217,8 @@

 To fix this and successfully delete your previous default branch:
 1. Access your git repo over [SSH].
-2. Once connected, and inside the git repo directory, run `git symbolic-ref HEAD refs/heads/&amp;lt;branch name=""&amp;gt;` where `&amp;lt;branch name=""&amp;gt;` is the name of your new default branch (i.e. `main`).
+2. Once connected and inside the git repo directory, run `git symbolic-ref HEAD refs/heads/&amp;lt;branch name=""&amp;gt;` where `&amp;lt;branch name=""&amp;gt;` is the name of your new default branch (i.e. `main`).
 3. Now, from your local repo you should be able to run `git push origin --delete &amp;lt;old-branch-name&amp;gt;`.
-4. Alternatively, while still connected over SSH you can run `git branch -D &amp;lt;old-branch-name&amp;gt;`, then from your local repo run `git fetch --prune`.
 #Backups
 SourceForge.net performs routine backups for all of our servers and will restore from these backups in the event of catastrophic server failure. We encourage projects to make their own backups of Git data as that data restore can be performed by the project in the event of accidental data destruction by a member of the project team.

&amp;lt;/old-branch-name&amp;gt;&amp;lt;/old-branch-name&amp;gt;&amp;lt;/branch&amp;gt;&amp;lt;/branch&amp;gt;&amp;lt;/branch&amp;gt;&amp;lt;/branch&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dillon Walls</dc:creator><pubDate>Mon, 20 Jul 2020 16:18:35 -0000</pubDate><guid>https://sourceforge.netfbe591f5be168fd876a955b9230c0275e237234e</guid></item><item><title>Git modified by Dillon Walls</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v37
+++ v38
@@ -188,6 +188,38 @@

 Then emails will be sent to the specified list for each commit.

+# Changing Default Branch
+If you want to change your git repo's default branch ( say from `master` to `develop` or `main`) , you can do it! 
+1. Go to your SF git tab.
+2. Click the "Admin - " drop down
+3. Click "Set default branch" and enter a new branch name
+
+## Deleting `master` After Changing Default Branch
+
+If you want to delete your previuos default branch (i.e. `master`) after changing your default (advanced users only), you are able to. However, the commands that normally do this will throw an error as shown below:
+
+```shell
+$ git checkout main
+$ git push origin --delete master
+remote: error: By default, deleting the current branch is denied, because the next
+remote: 'git clone' won't result in any file checked out, causing confusion.
+remote:
+remote: You can set 'receive.denyDeleteCurrent' configuration variable to
+remote: 'warn' or 'ignore' in the remote repository to allow deleting the
+remote: current branch, with or without a warning message.
+remote:
+remote: To squelch this message, you can set it to 'refuse'.
+remote: error: refusing to delete the current branch: refs/heads/master
+To ssh://git.code.sf.net/PATH/TO/GIT/REPO
+ ! [remote rejected] master (deletion of the current branch prohibited)
+error: failed to push some refs to 'ssh://USERNAME@git.code.sf.net/PATH/TO/GIT/REPO'
+```
+
+To fix this and successfully delete your previous default branch:
+1. Access your git repo over [SSH].
+2. Once connected, and inside the git repo directory, run `git symbolic-ref HEAD refs/heads/&amp;lt;branch name=""&amp;gt;` where `&amp;lt;branch name=""&amp;gt;` is the name of your new default branch (i.e. `main`).
+3. Now, from your local repo you should be able to run `git push origin --delete &amp;lt;old-branch-name&amp;gt;`.
+4. Alternatively, while still connected over SSH you can run `git branch -D &amp;lt;old-branch-name&amp;gt;`, then from your local repo run `git fetch --prune`.
 #Backups
 SourceForge.net performs routine backups for all of our servers and will restore from these backups in the event of catastrophic server failure. We encourage projects to make their own backups of Git data as that data restore can be performed by the project in the event of accidental data destruction by a member of the project team.

&amp;lt;/old-branch-name&amp;gt;&amp;lt;/old-branch-name&amp;gt;&amp;lt;/branch&amp;gt;&amp;lt;/branch&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dillon Walls</dc:creator><pubDate>Mon, 20 Jul 2020 16:15:43 -0000</pubDate><guid>https://sourceforge.neta9a9e20698b7302d1d50a71e8b7ca56f089a9916</guid></item><item><title>Git modified by Dave Brondsema</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v36
+++ v37
@@ -115,6 +115,7 @@
 For any local Git repository, you can configure it to push data back to our server by doing the following from inside your Git repository (this replicates what a "git clone" from our servers sets up for you automatically):

     $ git remote add origin ssh://USERNAME@git.code.sf.net/p/PROJECTNAME/REPOSITORY
+    # if you get an error about already having a remote origin, then run: "git remote remove origin" and try again
     $ git config branch.master.remote origin
     $ git config branch.master.merge refs/heads/master

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Tue, 20 Aug 2019 17:23:56 -0000</pubDate><guid>https://sourceforge.netb26f484b85f417ac249d40ec714f480c28e752d9</guid></item><item><title>Git modified by Dave Brondsema</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v35
+++ v36
@@ -112,8 +112,6 @@

 #How to push a local repository

-If you did not clone one of our remote repositories (for instance, if your older git version won't let you clone an empty repository), you will have to take some manual setup steps to be able to push your content to our servers.
-
 For any local Git repository, you can configure it to push data back to our server by doing the following from inside your Git repository (this replicates what a "git clone" from our servers sets up for you automatically):

     $ git remote add origin ssh://USERNAME@git.code.sf.net/p/PROJECTNAME/REPOSITORY
@@ -128,7 +126,7 @@

 After the first push, you will be able to use the simpler "git push" to push the master branch to our "origin" server.

-Once that is done, you will be able to browse your newly-committed content via gitweb, clone the repository via either read-only or read/write access methods, push more check-ins, etc.
+Once that is done, you will be able to browse your newly-committed content via the web, clone the repository via either read-only or read/write access methods, push more check-ins, etc.

 # Webhooks
 Webhooks are available for all code repositories. To configure a webhook, go to your repository and in the left menu expand the Admin section. Then click the "Webhooks" link. You can create and update your webhooks there.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Tue, 20 Aug 2019 17:21:26 -0000</pubDate><guid>https://sourceforge.net88919bcc8d6cfea21c89d9fa40f5c97acbe3a9d0</guid></item><item><title>Git modified by Dave Brondsema</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v34
+++ v35
@@ -143,6 +143,12 @@

 Note that the directory is mounted during the shell creation, if you create a new repository while an existing shell session is still active, use the `shutdown` command on the shell and start a new session.

+## Allowing force pushes
+
+Use the above instructions to access your repository via an SSH shell.  Then edit the `config` file and set `denyNonFastforwards = false`.
+
+For more control over what branches or what users can do a force push, you will need to set up a custom server-side hook.
+
 ## Server Hooks

 Direct access to the repository can be used to install [custom git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) server-side.  Use our [Shell Service] access and then go to the `/home/git/p/PROJECTNAME/REPO.git/hooks` directory.
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Fri, 31 May 2019 17:05:02 -0000</pubDate><guid>https://sourceforge.netdbfd69724799ac1e623d2c8ef600c1d30398a9ce</guid></item><item><title>Git modified by Dave Brondsema</title><link>https://sourceforge.net/p/forge/documentation/Git/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v33
+++ v34
@@ -99,7 +99,7 @@
         RSA key fingerprint is 86:7b:1b:12:85:35:8a:b7:98:b6:d2:97:5e:96:58:1d.
         Are you sure you want to continue connecting (yes/no)?

-Before typing 'yes' to accept the host fingerprint, ensure the fingerprint is correct for the host. You can find a listing of SSH host keys in the SSH Host Key Fingerprints list. If you receive a host key warning, please contact the SourceForge.net team.
+Before typing 'yes' to accept the host fingerprint, ensure the fingerprint is correct for the host. You can find a listing of SSH host keys in the [SSH Key Fingerprints list](SSH Key Fingerprints). If you receive a host key warning, please contact the SourceForge.net team.

 ##Setting your git username

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave Brondsema</dc:creator><pubDate>Mon, 22 Jan 2018 18:08:39 -0000</pubDate><guid>https://sourceforge.net50c33cd2138f811043b37020182e4eabb23df66d</guid></item></channel></rss>