1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Configuring, Using GitHub Branching and Merging

Recently, I had to work with a repository on GitHub, below are my notes on configuration, usage etc.. Note: To work with git there are many helpful utility’s. one rely widely used helpful utility is called bash-it, it will help with your branching and many more, available here. First, sign-up for a GitHub account, easily done on Then, go to create a new repository, simple steps to follow. Below, I am working with a repository named coreos-kubernetes-generator First lest clone the repository.
git clone
To add a file readme.txt, run the below.
git add readme.txt
To add all files/folder
git add . 
# Or
git add -A
To commit the file to your local cloned git repository.
git commit -m "Adding readme.txt"
To push all your changes to the master branch, just run the below.
git push
To get the latest changes
cd coreos-kubernetes-generator 
git pull 
Now, lets create a new branch, I will name this branch Version-02.
git branch Version-02
Now lets switch to the new branch Version-02. Note: git uses the checkout option to switch to a different branch(or back to master).
git checkout Version-02
Same as above, to add all changes.
git add .
To set the executable bit on a file, just run the below.
git update-index --chmod=+x bin/
To commit all changes.
git commit 
# or
git commit -am "reason for change"
Finally, to push all changes to github.
git push origin Version-02
Now, login to github and merge and apply all changes to the master (if all is correct). Since I am using tow-factor authentication so called Tow-step authentication, the extra steps below are required. Lets configure our local Github properties.
git config --global ""
git config --global "Eli"
The below will help for two factor authentication. Enable user/password cache
git config --global credential.helper cache
Next time you push changes to github, it will ask for your user login name. Then for password use your GitHub API/Two-factor key. Like what you’re reading? please provide feedback, any feedback is appreciated.
0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x
%d bloggers like this: