Git Organization and Team

Before I start my with the details on how to create a free organization and team in Git, I wanted to thanks my colleague Kiara Robles. Before she introduce me and my team regarding the open source version of the Git organization, I was working in the dark with individual accounts and having a lot of troubles coordinating between team members.

Below are the steps to create an open source organization and a team. The owner of the organization can easily assign access right to the whole team or specific team members. If you are working in a team of multiple members and managing the same repository, the organizing and team feature will save you from a lot of troubles.

Personal Setting page in GIT. Start a new organization under the Organizations tab.
Choose the Open Source plan for the Organization type.

Once you created an organization, you can create a Git team and a repository. Assigning a whole team to a repository is a great feature where the owner of the organization can manage the access for the whole team.

Git SSH Key

Permission denied

After creating a repository with the new organization, the first thing I did was to make a README change try to push it. While pulls and commits are working as expected with the new repository, I am started running into troubles with git push. I spent hours of googling and asking around to try and solve the above git push error but still no luck on fixing it. Later on, with the help of my instructor we found out that the error is caused by the SSH Key authorization. Since my machine is linked to another organization, I am not able to use the same key to access the newly created organization repository.

Generating New SSH Key

One of the solution to use SSH key for the newly created organization is to generate a new SSH Key and add it to the SSH agent. Once the SSH key is generated and added to the agent, git push is working as expected.

Great that the new repository is up, the SSH key is ready and the team can start working on it. However, when I try to change back to my other organization’s repository I am running into the same issue. Turn out that adding the new generated key to the SSH agent will not add a new key on top of the old one; instead, it will override the old key.

Git HTTP Workaround

At the end, I am ending up using the http url for setting up the git remote url. It is a pain to enter the username and password for the git account every time after a git push, but it works.

For lazy people like myself, to avoid entering the username and password every time using a key storage is an option. Caching the username and password will store the information in a storage where the user only need to enter the username and password on the first time setting up the repository. Due to security measures, this is highly unrecommended, but it is an option.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.