惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
IT之家
IT之家
博客园 - 【当耐特】
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Hugging Face - Blog
Hugging Face - Blog
I
InfoQ
B
Blog RSS Feed
腾讯CDC
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
雷峰网
雷峰网
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
DataBreaches.Net
The Cloudflare Blog
V
V2EX
S
SegmentFault 最新的问题

ashishb.net

A day in Luxembourg - the richest country in the world I was asked to install malware during a fake interview Book summary: Breakneck - China's quest to engineer the future by Dan Wang Book summary: How to Teach Your Baby to Read Book Summary: The Discontented Little Baby Book by Pamela Douglas Introducing Amazing Sandbox - run third-party tools and AI agents securely on your machine Why software outsourcing gets a bad reputation? Book summary: The Natural Baby Sleep Solution by Polly Moore A day in Antwerp, Belgium Journey of online influencers Two days in Brussels, Belgium Shortcuts - when we love them and when we don't A visit to Rakhigarhi Three days in overhyped Paris Empty Japan, crowded Tokyo The real lock-in in GitHub is not the code, but the stars 11-day Norwegian Breakaway East Caribbean cruise Sanskrit and Sri Lankan Air Force Use REST with Open API The Achilles heel of American capitalism Costa Rica in 4 days At a juice stall in Sri Lanka A short stay at Warsaw, Poland Best practices for using Python & uv inside Docker Two days in Vilnius, Lithuania How IntelliJ IDEs waste disk space Pregnancy Why there aren't many digital nomads from India Two days in Riga, Latvia To keep your machine secure, run third-party tools inside Docker
Github 101 for hackathons
Ashish Bhatia · 2013-12-31 · via ashishb.net

This blog post is a HOWTO guide for using github while collaborating during hackathons. It does not cover git in detail.

One time setup

  1. Create github account by visiting https://github.com
  2. Generate SSH key locally and upload it to github

This setup ensures password-less (code) pull and push from github.

Per project setup

  1. Create a repo on github by submitting form at https://github.com/new

  2. Clone the repo locally using

    1
    
    git clone git@github.com:@.git

    This URL is mentioned on the bottom right side of the repo page. Note: It’s recommended to use the above style (SSH) instead of the HTTPS style so that, future submissions do not require retyping password.

  3. This will clone the (empty) repo into <reponame> directory.

  4. After “cd"ing that directory, you will be working on the master branch.

  5. Change to a new branch say user1 using

    Note: “-b” creates a branch and checks it out. If branch already exists, the command will fail, remove “-b” to check out (work on) that branch.

  6. To see which branch you are currently and how much its modified use,

  7. Now modify the files.

  8. To add a new file, after creating the file, do

  9. To remove a file, do

  10. All the changes made till this point are uncommitted, to see what changes will be committed in next commit, use

    and

  11. Once the changes look good, commit them using

  12. Now, the changes have been committed locally to user1 branch, to push the changes back to remote server (github), use

  13. Now the changes have been pushed to user1 branch on github server. Merge them by creating a pull request using master as base and user1 as branch to be merged.

  14. Step 13 can fail master has changed since the last time user1 was updated with master (in step 5). A fix for that is to execute following command before doing git push (step 12).

    In case of merge conflicts, this pull will produce files which had merge conflicts, review them looking for conflict markers ("««”, “»»”) and merge the code manually. After than perform another commit using git commit and continue from step 12.

Some more productivity tools focused on git

  1. My .gitconfig file for colors, aliases and some other settings.
  2. git auto completion on command line.
  3. vim-fugitive for vim users.