Rajeev Nair
Rajeev Nair

Reputation: 35

How to configure GitHub's Atom Editor with enterprise git

I just downloaded GitHub's Atom Editor on my Windows machine and now trying to Integrate my Atom editor with the git enterprise repo say, for example:

https://git.company.com/abc.git

so that I can clone, make changes and check in.

How do I go about accomplishing this?

Upvotes: 3

Views: 7983

Answers (2)

Richard Slater
Richard Slater

Reputation: 6378

For the purposes of this answer I shall assume that you have got a git repository available to you and have installed both the git-plus and the git-clone packages in Atom.

Configure Git Clone

Learning Objective: Configure Atom Editor and the Git Clone package to clone your git repositories in a sensible location.

  1. The first step is to configure Git Clone, open up settings by pressing Ctrl-,.
  2. Click on Packages on the left hand side the find git-clone.
  3. Click on the Settings button for the git-clone package this will open up the settings page.
  4. Set the Target Directory to something sensible for your operating system and setup. I would strongly recommend that this is a fast local drive such as a SSD.

Screenshot of Configuring Git Clone

Clone a Repository

Learning Objective: Get a copy of the code from a central repository onto your development machine using Atom Editor ant the Git Clone package.

  1. First identify the appropriate git URL, I will be using a GitHub URL but this could be any git URL.

     [email protected]:RichardSlater/activate-power-mode.git
    
  2. From Atom press Ctrl-Shift-P to open up the Command Palette then type: Git Clone to select Git Clone: Clone.

  3. Enter the git URL from step one above and press Enter.

Screenshot of Clone a Repository

Once you have completed the above three steps you will have a clone of the git repository and a new Atom window opened.

Make some changes

Learning Objective: See how to use Atom Editor and the Git Plus package to make some changes to your code and push these back up to the central repository.

  1. Select one of the files within the TreeView on the left hand side, in this example I am going to use lib/activate-power-mode.coffee.
  2. We're going to change the throttle limit on Line 32 from 25 to 50 - go ahead and make this change:

    @throttledSpawnParticles = throttle @spawnParticles.bind(this), 50, trailing: false
    
  3. Save this file, note that the color of the file in the TreeView has changed to Orange and the status bar will have a git status message on the right hand side:

    + 1, -1
    
  4. Now we need to add this file, open the Command Palette again by pressing Ctrl-Shift-P then typing git add, press enter to stage the current file.

  5. A green message will be displayed showing that the file was successfully added.
  6. Right lets go ahead and create a commit for this file; open the Command Palette again and type git commit, a new buffer will open where you can type a commit message. Go ahead and type a commit message.
  7. Press Ctrl+S to save the message, close the commit message buffer and create the commit.
  8. Finally push this commit to your repository by opening the Command Palette and typing git push.

You should now have made a change to your central git repository all from the Atom Editor.

Screenshot of Change and Commit

Upvotes: 5

Richard Slater
Richard Slater

Reputation: 6378

Although Atom is actively developed by GitHub it isn't strongly coupled to github.com or projects hosted with GitHub. I strongly recommend using the git-plus package which extends the built in git support significantly allowing among other things:

  • Branch Management
  • Adding of Files
  • Committing
  • Pushing and Pulling

Screenshot of Git Plus

As far as I am aware the only thing you can't do with Git Plus is clone a new repository, however clone is supported through the git-clone package:

Screenshot of Git clone

While this screenshot shows the GitHub web interface, you can in fact use any git repository URI.

Upvotes: 1

Related Questions