Although the GitHub docs contains good info on how to add an existing GitHub project to your local machine, how to add an existing (unversioned) project from your local machine to GitHub was a little less clear to me. Here are the steps I use.
- Select ‘VCS’ menu -> Import in Version Control -> Share project on GitHub.
- You may be prompted for you GitHub, or IntelliJ Master, password
- Select the files to commit
In the latest version (v13) of IntelliJ, you will then be prompted for which files you wish to include as part of the initial commit. Obviously deselect anything in the target (aka classes) folder. I also exclude the .idea folder. Click OK and you new project and files should now be available via GitHub!
In older versions of IntelliJ, this step (somewhat strangely) created the project with just the readme. Follow the the next step to add the other files.
To add more files:
- Select files to add
- Right click -> Git -> Add
- Commit files (Ctrl-K or VCS -> Git -> Commit) [Commit & push easier, but can also just Commit]
- If files not pushed in step above, VCS -> Git -> Push
From command line
I think the following steps do the same thing from the command line, but it has been a while since I used them:
- Create a new repository
- cd to your project directory e.g. cd projects/newproject
- Run the following git commands
- git init
- git add .
- git commit -m “Initial commit”
- git remote add origin https://github.com/username/projectname.git
- I think: git remote add origin firstname.lastname@example.org:username/projectname.git does the same thing.
- The ‘origin’ name is arbitrary (As with branch naming, remote alias names are arbitrary – just as ‘master’ has no special meaning but is widely used because
git initsets it up by default, ‘origin’ is often used as a remote name because
git clonesets it up by default as the cloned-from URL. You can really name it just about anything.)
- git push -u origin master
- (Note to remove a remote again: git remote rm origin)
|Reference:||How to add an IntelliJ project to GitHub from our JCG partner Shaun Abram at the Shaun Abram’s blog blog.|
Bulletproof Java Code: A Practical Strategy for Developing Functional, Reliable, and Secure Java Code
Use Java? If you do, you know that Java software can be used to drive application logic of Web services or Web applications. Perhaps you use it for desktop applications? Or, embedded devices? Whatever your use of Java code, functional errors are the enemy!
To combat this enemy, your team might already perform functional testing. Even so, you're taking significant risks if you have not yet implemented a comprehensive team-wide quality management strategy. Such a strategy alleviates reliability, security, and performance problems to ensure that your code is free of functionality errors.Read this article to learn about this simple four-step strategy that is proven to make Java code more reliable, more secure, and easier to maintain.