Open https://github.com/lightningnetwork/lnd and while logged in, select the "Fork" option and follow any prompts.
Open terminal and type
git clone https://github.com/YOUR-USERNAME/lnd.git lnd-yourname
or if you have ssh keys setup for your git profile
git clone git@github.com:YOUR-USERNAME/lnd.git lnd-yourname
then change to the directory
cd lnd-yourname
If there have been commits since you cloned your fork, you will need to update from the master tree.
git remote add upstream git://github.com/lightningnetwork/lnd.git
git fetch upstream
git pull upstream master
git rebase upstream/master
Edit the various files in your desired editor. Save and exit.
To add a lot of files you can use
git add *
or just a single file
git add <filename-which-changed>
git commit -m "this is an explanatory message"
You will need to provide your github user/pass for this next step, or have ssh keys setup in your github account.
git push
Back in your browser, navigate to https://github.com/YOUR-USERNAME/lnd and select "Pull Request".
Github will check your fork against the original and highlight the changed files.
Proceed to add the PR and include a useful message.
You can keep your fork up to date with
# Checkout your master branch and merge upstream
git checkout master
git rebase upstream/master
Prior to submitting your pull request, you might want to do a few things to clean up your branch and make it as simple as possible for the original repo's maintainer to test, accept, and merge your work.
If any commits have been made to the upstream master branch, you should rebase your development branch so that merging it will be a simple fast-forward that won't require any conflict resolution work.
# Fetch upstream master and merge with your repo's master branch
git fetch upstream
git checkout master
git merge upstream/master
# If there were any new commits, rebase your development branch
git checkout newfeature
git rebase master
Now, it may be desirable to squash some of your smaller commits down into a small number of larger more cohesive commits. You can do this with an interactive rebase:
# Rebase all commits on your development branch
git checkout
git rebase -i master
This will open up a text editor where you can specify which commits to squash.