Add files to a new Git Repository

Navigate to the location of the files to add:

git init

Add the remote repository:

git remote add origin <your-git-repo-url>

Note: If your Git repository already has files (like a README), you might need to pull first:

git pull origin master --allow-unrelated-histories

Then you can add and push your changes.

Add all existing files:

git add .

Create your first commit:

git commit -m "Initial commit"

Push to the remote repository:

git push -u origin master

Git Clone Error – fetch-pack: unexpected disconnect while reading sideband packet

$ git clone --verbose https://halprdgit01.hq.halw.com:8443/scm/nd/hap_group_ui-automation-2023.git
Cloning into 'hap_group_ui-automation-2023'...
Username for 'https://halprdgit01.hq.halw.com:8443': mlr
Password for 'https://mlr@halprdgit01.hq.halw.com:8443':

POST git-upload-pack (142 bytes)
POST git-upload-pack (gzip 4030 to 2040 bytes)
remote: Enumerating objects: 40934, done.
remote: Counting objects: 100% (40934/40934), done.
remote: Compressing objects: 100% (21475/21475), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 3784 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

Refer: https://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning

Quick solution:

With this kind of error, I usually start by raising the postBuffer size by:

git config --global http.postBuffer 524288000

(some comments below report having to double the value):

git config --global http.postBuffer 1048576000

Disable Windows Git Credential Manager

Refer: https://stackoverflow.com/questions/37182847/how-do-i-disable-git-credential-manager-for-windows

OK, I discovered that you need to either avoid checking the "Git Credential Manager" checkbox during the Git for Windows installer, or (after installation) run the Bash shell as Administrator and use git config --edit --system to remove the helper = manager line so that it is no longer registered as a credential helper.

For bonus points, use git config --edit --global and insert:

git config --edit --system

[core]
   askpass =

To disable the OpenSSH credentials popup too.

Git Cert Error

Use the following to accept a self-signed certificate:

$ git config --global http.sslVerify false

Refer: https://confluence.atlassian.com/fishkb/unable-to-clone-git-repository-due-to-self-signed-certificate-376838977.html

Update Git

Refer: https://askubuntu.com/questions/579589/upgrade-git-version-on-ubuntu-14-04

$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git
$ git --version

Look for deleted files in Git

# Example to quickly look for a deleted file
$ git log --diff-filter=D --summary | grep -i delete | grep -i barclay

Use this to find actual commit for file and you can search it like a less command
$ git log --diff-filter=D --summary

Refer: http://stackoverflow.com/questions/7203515/how-to-locate-a-deleted-file-in-the-commit-history

Restful Servies, Git and Other Materials

From: DCosta, John (HAL) Sent: Wednesday, December 17, 2014 4:55 PM

http://git-scm.com/book/en/v2

http://www.javaworld.com/article/2113465/developer-tools-ide/git-smart-20-essential-tips-for-git-and-github-users.html

http://fideloper.com/hexagonal-architecture

http://alistair.cockburn.us/Hexagonal+architecture

http://codeplanet.io/principles-good-restful-api-design/

http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/

http://www.slideshare.net/mario_cardinal/best-practices-for-designing-pragmatic-restful-api

http://blog.2partsmagic.com/restful-uri-design/

http://martinfowler.com/articles/microservices.html

http://www.codingpedia.org/ama/tutorial-rest-api-design-and-implementation-in-java-with-jersey-and-spring/