在Linux中使用git

cd 20240714/lesson1

blog.csdn.net/weixin 36138385/article/details/117103723

设置颜色c语言

进度条练习

@centos lesson1]$ cat process.h
#pragma once

#include<stdio.h>
#include<string.h>
#include<unistd.h>


#define NUM 101

#define S_NUM 5


extern void ProcessOn();
@centos lesson1]$ cat process.c
#include"process.h"

char style[S_NUM]={'-',',','#','>','+'};
void  ProcessOn()
{
    int cnt =0;
    char bar[NUM];
    memset(bar,'\0',sizeof(bar));
    const char* label = "|\\-/";
    while(cnt <=100)
    {
        printf("\033[42;34m[%-100s][%d%%][%c]\033[m\r",bar,cnt,label[cnt%4]);
        fflush(stdout);
        bar[cnt++] = style[N];
        usleep(50000);
    }
    printf("\n");
}
@centos lesson1]$ cat main.c
#include"process.h"
#include<stdio.h>
int main()
{
    ProcessOn();
    return 0;
}
@centos lesson1]$ cat Makefile
ProcessOn:main.c process.c
        gcc -o ProcessOn  main.c process.c -DN=3
.PHONY : clean
clean:
        rm -f ProcessOn

git->版本控制器

push到远端的本质就是将.git中的内容同步到gitee中

@centos linux_practice]$ cp ../*.c .

将所有.c文件移到当前目录。

linux_practice]$ mv *.c process

将.c文件移到process文件夹中。

git的三板斧:

git add .

将当前文件放入.git(本地仓库。

@centos linux_practice]$ git commit -m '这是第一次在Linux中写多文件代码'
git push
git config --global user.name "Your Name"

git config --global user.email "you@example.com"

在Linux中设置git的账号的密码

git pull

将远端的数据同步到本地。

 

相关推荐

  1. Linux使用 Git LFS

    2024-07-16 13:40:04       27 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-16 13:40:04       67 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-16 13:40:04       72 阅读
  3. 在Django里面运行非项目文件

    2024-07-16 13:40:04       58 阅读
  4. Python语言-面向对象

    2024-07-16 13:40:04       69 阅读

热门阅读

  1. 运动控制:编码器滤波

    2024-07-16 13:40:04       15 阅读
  2. 数据分析常用工具汇总

    2024-07-16 13:40:04       20 阅读
  3. Sklearn 入门教程:开启机器学习之旅

    2024-07-16 13:40:04       19 阅读
  4. Swift入门笔记

    2024-07-16 13:40:04       20 阅读
  5. 【Linux命令 香橙派AI pro】使用命令连接wifi

    2024-07-16 13:40:04       20 阅读
  6. 常见逻辑漏洞举例

    2024-07-16 13:40:04       24 阅读
  7. Codeforces Round 958 (Div. 2)

    2024-07-16 13:40:04       23 阅读
  8. Python学习笔记

    2024-07-16 13:40:04       23 阅读
  9. Oracle 常用系统

    2024-07-16 13:40:04       20 阅读
  10. @Profile注解的作用是什么?

    2024-07-16 13:40:04       19 阅读