GitHub recently released a feature that allows users to create a profile-level README to display prominently on their GitHub profile. This article walks you through how to access this new feature.
The profile README is created by creating a new repository that’s the same name as your username. For example, my GitHub username is trickyj so I created a new repository with the name trickyj.
Note: at the time of this writing, in order to access the profile README feature, the letter-casing must match your GitHub username.
By default, PowerShell uses TLS 1.0. Because SEP (Symantec Endpoint Protection) uses TLS 1.2, you will receive a connection error message if you do not change this behaviour. To force PowerShell to use TLS 1.2, add the following line to your script:
Recently I came across through Facebook’s Open Source Immersion program.
The goal of this initiative is to provide developers with practical education and experience contributing to Open Source projects in preparation for our annual Developer Circles Community Challenge later this year.
Over one month starting July 15, 2020 at 12:00 AM PST, participants in the Open Source Immersion will be asked to submit a minimum of four Pull Requests (PR), where one out of four of these PRs will need to be aimed towards a Facebook-led Open Source project in the Developer Circles Repo.
In order to start contributing to open source projects, it is very important to learn how to work with GIT/GitHub. Trust me best way to learn is to start using it.
Let’s get started – In order to submit the Pull Requests (PR’s) we need to first know what is PR and how to work with it in GitHub.
Barnching, Merging, & Pull requests in GitHub.
Agenda –
An overview of branches
working with branches on GitHub
Pull requests and GitHub flow.
An overview of branching in Git
Much more lightweight
Branching is very fast
Encouraged to be used
Works because of the way git works.
Snapshots
Note – Commits in Git
Every time you commit git will store a pointer to one of its snapshots.
Note – Branching in git –
Branch is a pointer to a commit.
Default branch is master
points to latest commit.
Moves forward with every commit.
Use branches for.
When to create branches ?
Features – when creating/adding new features.
Bugs – If you want fix bug.
Experiments – If you want to experiment.
Note –
When you create new branches, the Master branch is not changed.
Once u are happy with the changes in the branches then merge it with a master.
Demo1 : Creating a Branch on GitHub | The Commands for the Branching.
Create New Branch with this command
$ git branch [ barnch name ]
The above command will show you all the branches in your repo.
$ git checkout [ branch name ]
With the above command you can switch from one branch to another, At this point the files in the working directory are replaced with the one’s in that current branch.
$git push -u [ origin ] [ branch ]
When you create new branch, it is not pushed to GitHub automatically. You will have to use the above command with -u parameter then the new branch will be pushed to Github.
Demo2 : Creating files on Github demo of git branching
In this Demo we will create a local branches and then push those to github.
commands are –
$ git checkout -b "new-branch"
The above command will create new branch and will also switch you to that new branch.
Next, you make any changes in ur code.
Next, stage those changes with the command (git add .)
Next, commit those changes with the command (git commit -m "your commit")
Then push it to remote branch with the command (git push -u origin [new branch name])
Pull Requests and the GitHub Flow
Using the pull request (PR) you are telling that you have pushed to a branch of a repo. and made changes in a separate branch.
We need to open the pull request, to discuss review and add more commits.
Once this is approved it will be merged into the base branch.
Demo1 : – Working with pull requests.
In this demo we will perform the below given task.
Creating a pull request for our branch
Adding more commits
Adding comments
Exploring the files in the PR (Pull request)
Merging the PR into the branch
Deleting the branch
Step 1: – How to create pull Request on Github ?
Inside your repo where you have created new branch, you will see a Compare and Pull request button.
It will show you the options to Open a pull request Create a new pull request by comparing changes across two branches. If you need to, you can also .
Step 2: – You can also manually create new pull request by clicking the Pull Request’s tab > New pull Request button.
Note – Able to merge. These branches can be automatically merged.
Note – Now under create pull request button we can also see Create Draft Pull Request (Cannot be merged until marked for review)
Step 3: – Now click Merge Pull request button and click confirm merge.
You will see a message – Pull request successfully merged and closed
And you will get a Delete branch button to delete your baranch.
Note – Inside this button there are 3 options
Create a Merge Commit – All commits from this branch will be added to the base branch via a merge commit.
Squash and merge – The 1 commit from this branch will be added to the base branch.
Rebase and merge – The 1 commit from this branch will be Rebased and added to the base branch.
Step 4: – I clicked on Delete Branch and now I got the message – @trickyj trickyj deleted the add-installation branch now
Note – Once you delete or make changes on GitHub website you will have to fetch/Pull those to your local repo.
This was the error message I got when I tried to upload my changes to the remote repo.git push origin master.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: e397fc16b6c3b712eb7068d69417a5b1
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File final_movie.mov is 317.20 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/trickyj/daboo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/trickyj/daboo.git'
In order to resolve the above error. I wanted to remove that large size .mov file from my previous commit.
The first thing that came in my mind was to manually delete the final_movie.mov file from my project folder on my laptop. Then commit the changes.
But, this didn’t work. I was still getting the same error. The .mov file was already stored in my .git folder on my local machine project folder.
Removing a File from Every Commit
This occurs fairly commonly. Someone accidentally commits a huge binary file with a thoughtless git add ., and you want to remove it everywhere. Perhaps you accidentally committed a file that contained a password, and you want to make your project open source. filter-branch is the tool you probably want to use to scrub your entire history. To remove a file named passwords.txt from your entire history, you can use the –tree-filter option to filter-branch:
$ git filter-branch –tree-filter ‘rm -f passwords.txt’ HEAD
Rewrite 6b9b3cf04e7c5686a9cb838c3f36a8cb6a0fc2bd (21/21)
Ref ‘refs/heads/master’ was rewritten
The –tree-filter option runs the specified command after each checkout of the project and then recommits the results. In this case, you remove a file called passwords.txt from every snapshot, whether it exists or not. If you want to remove all accidentally committed editor backup files, you can run something like git filter-branch --tree-filter 'rm -f *~' HEAD.
You’ll be able to watch Git rewriting trees and commits and then move the branch pointer at the end. It’s generally a good idea to do this in a testing branch and then hard-reset your master branch after you’ve determined the outcome is what you really want. To run filter-branch on all your branches, you can pass –all to the command.